Install pip for specific python version
Question:
We have installed python 3.9 from external Link, my OS has in built python 3.6 and python3-pip for 3.6 version. If I install pip packages it will install for python 3.6 and it is not compatible for python 3.9. How to install pip3.9 ? so that i will install packages from pip3.9 command.
OS: Cent OS
I tried like this
python3.9 -m pip
python3.9: No module named pip
Answers:
Some Python distributions may not come with pip
installed. Try
python3.9 -m ensurepip
to install pip
for your interpreter first.
Adding on @Selcuk ‘s answer, you can define which python version runs pip:
For example:
/path/to/python3.9/python -m pip install mypackage
This would install mypackage
for the python version you referenced to.
Another suggestion is to use Conda, which handles different python versions pretty effectively.
to install pip in the version you want: python3.VERSIONYOUINSTALLED -m ensurepip and then you can use with python3.VERSIONYOUINSTALLED -m pip install PACKAGEYOUWANT
We have installed python 3.9 from external Link, my OS has in built python 3.6 and python3-pip for 3.6 version. If I install pip packages it will install for python 3.6 and it is not compatible for python 3.9. How to install pip3.9 ? so that i will install packages from pip3.9 command.
OS: Cent OS
I tried like this
python3.9 -m pip
python3.9: No module named pip
Some Python distributions may not come with pip
installed. Try
python3.9 -m ensurepip
to install pip
for your interpreter first.
Adding on @Selcuk ‘s answer, you can define which python version runs pip:
For example:
/path/to/python3.9/python -m pip install mypackage
This would install mypackage
for the python version you referenced to.
Another suggestion is to use Conda, which handles different python versions pretty effectively.
to install pip in the version you want: python3.VERSIONYOUINSTALLED -m ensurepip and then you can use with python3.VERSIONYOUINSTALLED -m pip install PACKAGEYOUWANT