Active7 months ago
I'm using CentOS 7. I want to use Pip to install a virtualenv . So I installed Pip like so ...
but then when I actually try and use pip, i'm told it can't be found ...
Is there a way to set the Python 3.5.2 as the default Python version on CentOS 7? Currently, I have Python 2.7 installed as default and Python 3.5.2 installed separately. I used the following comm.
How do I properly install pip on my Linux distro?
DaveDave65966 gold badges2323 silver badges5353 bronze badges
2 Answers
Summarised from another site:
Core package repositories for CentOS 7 does not have
python-pip
. For that you need to enable an EPEL ('Extra Packages for Enterprise Linux') repository. You do that with After that, you should be able to install
pip
withAlso possibly related:
- How to install pip in CentOS 7? (on StackOverflow, old)
- Recommended way to install pip(3) on centos7 (on StackOverflow, newer)
In particular, one answer there states that
Since Python 3.5,
Kusalananda♦Kusalanandapip
is already bundled with the python distribution, so you can just run python3.6 -m pip
instead of pip
.168k2020 gold badges326326 silver badges522522 bronze badges
alternate solution:
wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
RobotJohnnyRobotJohnny
Not the answer you're looking for? Browse other questions tagged centospythonpython3pip or ask your own question.
Active5 months ago
I am interrested in knowing the recommended way to install pip3 for python3.6 (as of today, may 2018) on current version of centos7 (7.5.1804) and the accepted answer of How to install pip in CentOS 7? seems to be outdated because:
outputs (among other things):
and
python34-pip
seems to be a (newer?) simpler way than the accepted answer of How to install pip in CentOS 7? :sudo yum install python34-setuptools
sudo easy_install-3.4 pip
But since the versions of python installed on my machine are 2.7.5 and 3.6.3 why is it python34-pip and not python36-pip ? Is pip the same for 3.4+ (up to current 3.6.3) ?
shrimpdrakeshrimpdrake56422 gold badges66 silver badges1818 bronze badges
7 Answers
- Is pip the same for 3.4+No, it's not. A single
pip
installation serves a single Python distribution (pip2.7
/pip3.4
/pip3.5
etc). - Since Python 3.5,
pip
is already bundled with the python distribution, so you can just runpython3.6 -m pip
instead ofpip
. - Python 3.6 is not available in CentOS 7 vanilla repo. I usually resort to IUS repo when needing to install a fresh Python on CentOS. It always has the most recent Python version, the current one being 3.6.5. It also offers a correspondent
pip
package.Unfortunately, IUS doesn't offer a package for Python 3.7 yet so if you are looking for Python 3.7 on CentOS 7, building from source is your only option.
Edit: when yum
is not an option
You should prefer the bootstrapping solution described in this answer as it is the most reliable way to get a working
hoeflinghoeflingpip
installed.20.5k66 gold badges4545 silver badges8181 bronze badges
To install pip for python 3.6 on CentOS 7 you need to run
$ python3.6 -m ensurepip
Андрей НаумовАндрей Наумов
Follow these commands in Centos 7
to check the pip version:
Rajiv SharmaRajiv Sharma
There is now a
python36-pip
package in EPEL.First, ensure EPEL is available and install
epel-release
if missing (this command works on a fresh system; ymmv depending on specific configurations of Yum repositories):Installing
python36-pip
will also install python36
, python36-libs
, and python36-setuptools
:You can now verify the version (yes, it is old, but it's what is coming from EPEL):
If you don't want to stray from the files provided by the
python36-pip
package and you don't want to see warnings about pip being old, see https://stackoverflow.com/a/46288945/534275 for silencing the messages.Alan IveyAlan Ivey
Pip is not bundled in the EPEL version of python 3.6 for some reason. I assume a decent amount of people (such as me) will find this page because of that.
So in this case, the setuptools package was the easiest solution.
xjsc16xxjsc16x12311 gold badge33 silver badges1414 bronze badges
In case you're seeing that pip3 is linked to python2 path:
$ pip3 -V
pip 8.1.2 from /usr/lib/python2.7/site-packages/pip (python 2.7)
You'll probably get:
$ pip3 install --upgrade pip
TypeError: parse() got an unexpected keyword argument 'transport_encoding'
Then try to clear commands cache with hash -r. This has worked for me:
Noam ManosNoam Manos7,01411 gold badge3838 silver badges4343 bronze badges
Sachin VermaSachin Verma