Python virtual env on centos
[velmuruganponnusamy@localhost Desktop]$ sudo yum install python-pip
[sudo] password for velmuruganponnusamy:
Last metadata expiration check: 0:17:38 ago on Mon 21 Nov 2022 02:32:13 PM IST.
Dependencies resolved.
====================================================================================================================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================================================================================================================
Installing:
python3-pip noarch 21.2.3-6.el9 appstream 2.0 M
Transaction Summary
====================================================================================================================================================================================================================
Install 1 Package
Total download size: 2.0 M
Installed size: 8.7 M
Is this ok [y/N]: y
Downloading Packages:
python3-pip-21.2.3-6.el9.noarch.rpm 600 kB/s | 2.0 MB 00:03
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 445 kB/s | 2.0 MB 00:04
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-pip-21.2.3-6.el9.noarch 1/1
Running scriptlet: python3-pip-21.2.3-6.el9.noarch 1/1
Verifying : python3-pip-21.2.3-6.el9.noarch 1/1
Installed:
python3-pip-21.2.3-6.el9.noarch
Complete!
velmuruganponnusamy@localhost Desktop]$ sudo pip install virtualenv
Collecting virtualenv
Downloading virtualenv-20.16.7-py3-none-any.whl (8.8 MB)
|████████████████████████████████| 8.8 MB 854 kB/s
Collecting platformdirs<3,>=2.4
Downloading platformdirs-2.5.4-py3-none-any.whl (14 kB)
Collecting filelock<4,>=3.4.1
Downloading filelock-3.8.0-py3-none-any.whl (10 kB)
Collecting distlib<1,>=0.3.6
Downloading distlib-0.3.6-py2.py3-none-any.whl (468 kB)
|████████████████████████████████| 468 kB 2.0 MB/s
Installing collected packages: platformdirs, filelock, distlib, virtualenv
WARNING: The script virtualenv is installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed distlib-0.3.6 filelock-3.8.0 platformdirs-2.5.4 virtualenv-20.16.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[velmuruganponnusamy@localhost Desktop]$ which virtualenv
~/.local/bin/virtualenv
[velmuruganponnusamy@localhost Desktop]$ which python
/usr/bin/python
[velmuruganponnusamy@localhost Desktop]$ python --version
Python 3.9.14
velmuruganponnusamy@localhost Desktop]$ cd python-algo/
[velmuruganponnusamy@localhost python-algo]$ virtualenv -p /usr/bin/python venv/
created virtual environment CPython3.9.14.final.0-64 in 571ms
creator CPython3Posix(dest=/home/velmuruganponnusamy/Desktop/python-algo/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/velmuruganponnusamy/.local/share/virtualenv)
added seed packages: pip==22.3.1, setuptools==65.5.1, wheel==0.38.4
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
[velmuruganponnusamy@localhost python-algo]$
[velmuruganponnusamy@localhost python-algo]$ source venv/bin/activate
(venv) [velmuruganponnusamy@localhost python-algo]$ which python
~/Desktop/python-algo/venv/bin/python
(venv) [velmuruganponnusamy@localhost python-algo]$
Comments
Post a Comment