Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install pip in CentOS 7?

CentOS 7 EPEL now includes Python 3.4: yum install python34

However, when I try that, even though Python 3.4 installs successfully, it doesn't appear to install pip. Which is weird, because pip should be included by default with Python 3.4. which pip3 doesn't find anything, nor does which pip.

How do I access pip from the Python 3.4 package in CentOS 7 EPEL release?

like image 954
Jeff Widman Avatar asked Sep 16 '15 21:09

Jeff Widman


People also ask

Does pip work with CentOS?

The yum package repository cache should be updated. Python PIP is not available in the official package repository of CentOS 7. But it is available in the EPEL package repository. Before you can install Python PIP on CentOS 7, you must add EPEL repository to your CentOS 7.


2 Answers

The easiest way I've found to install pip3 (for python3.x packages) on CentOS 7 is:

$ sudo yum install python34-setuptools $ sudo easy_install-3.4 pip 

You'll need to have the EPEL repository enabled before hand, of course.

You should now be able to run commands like the following to install packages for python3.x:

$ pip3 install foo 
like image 69
foobrew Avatar answered Sep 21 '22 03:09

foobrew


curl https://bootstrap.pypa.io/get-pip.py | python3.4 

Or if you don't have curl for some reason:

wget https://bootstrap.pypa.io/get-pip.py python3.4 get-pip.py 

After this you should be able to run

$ pip3 
like image 43
DevOops Avatar answered Sep 22 '22 03:09

DevOops