How to install packages for Python 3.6 in CentOS 7?¶
Installing pip package manager and Python 3.6 packages if they are missing from the operating system repository¶
Download package
get-pip.py
:wget https://bootstrap.pypa.io/get-pip.py
Install pip for required Python version:
sudo python3.6 get-pip.py
Install required package:
python36 -m pip install [Package_to_install]
Where
[Package_to_install]
is package name.
Installing pip package manager and Python 3.6 packages in virtual environment¶
Create the virtual environment:
python36 -m venv env --without-pip
Activate the virtual environment:
source env/bin/activate
Install pip in virtual environment:
curl https://bootstrap.pypa.io/get-pip.py | python3
Install required package:
pip3 install [Package_to_install]
Where
[Package_to_install]
is package name.