I'm using CentOS 7. I want to use Pip to install a virtualenv . So I installed Pip like so ...

[laredotornado@server Python-3.7.2]$ sudo yum install python-pip httpd mod_wsgi
[sudo] password for laredotornado: 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fileplanet.com
 * extras: mirror.us-midwest-1.nexcess.net
 * updates: mirror.fileplanet.com
No package python-pip available.
Package httpd-2.4.6-88.el7.centos.x86_64 already installed and latest version
Package mod_wsgi-3.4-18.el7.x86_64 already installed and latest version
Nothing to do

but then when I actually try and use pip, i'm told it can't be found ...

[laredotornado@server Python-3.7.2]$ sudo pip install virtualenv
sudo: pip: command not found

How do I properly install pip on my Linux distro?

  • Do you have an EPEL repository added? – Kusalananda Feb 19 at 22:51

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

sudo yum install epel-release

After that, you should be able to install pip with

sudo yum install python-pip

Also possibly related:

In particular, one answer there states that

Since Python 3.5, pip is already bundled with the python distribution, so you can just run python3.6 -m pip instead of pip.

  • 1
    Also, you can do “python3 -m venv” instead of using pip to install virtualenv in the first place. – jsbillings Feb 19 at 23:56
  • I've installed epel, done yum update/upgrade, and yum still can't find python-pip. – falsePockets May 15 at 1:25

alternate solution:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.