How to install Python pip on CentOS/Debian/Ubuntu

Updated on September 3, 2017

Pip is a package management system used to install and manage software packages written in Python. Many packages can be found in the Python Package Index (PyPI). Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip (pip3 for Python 3) by default, so you may have pip already.

Using OS Package Managers

On Linux, pip can be installed using system package manager as shown below:

On Debian/Ubuntu:

[root@openstack export]# apt-get install python-pip

On Fedora/CentOS/RHEL:

[root@openstack export]# yum install python-pip

If above commands didn’t work for you, then you may install PIP manually

Python pip on Linux

PIP Installation

[root@openstack export]# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate

Run the below command:

[root@openstack export]# python get-pip.py

get-pip.py will install setuptools also for you, if not already installed.

Now you have installed pip package manager successfully.

Note: In case, if 'python get-pip.py' ended up with "Syntax Error at line 43", then you need to check the version of Python. Pip is not supported in Python version 2.4, you may need to install Python version > 2.4. Here's a guide that explains Installation of Python version 3.5 from source.

How to Upgrade pip

On Linux or OS X: Run the below command.

[root@openstack export]# pip install -U pip
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: pip in /usr/lib/python2.6/site-packages

Was this article helpful?

Related Articles

Leave a Comment