How to Install Pip on CentOS 7

January 17, 2019

Introduction

Pip Installs Packages (Pip) is a package management system that simplifies installing and managing software packages written in Python.

Since it is a command-line program, when installed, Pip’s command line is added to the system. All packages listed in the Python Package Index (PyPI) can be installed using Pip. It comes as standard on Python 2.7.9 or higher (on Python series 2) and Python 3.4 or higher (on Python series 3).

In this tutorial, learn how to install Pip on Centos 7.

Tutorial on how to install Pip on CentOS 7

2 Options For Installing Pip on CentOS

Installing Pip on CentOS 7 is a very simple process.

There are two methods:

  1. Install with Curl and Python
  2. Installing with Yum

Both methods are explained in the sections below.

Note: If you are running a newer CentOS version, refer to How to Install Pip on CentOS 8.

Install Pip on CentOS 7 with Curl and Python

1. Download the package from the official repository using the curl command:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

2. Then, install Pip with:

sudo python get-pip.py

3. Next, verify the installation:

pip -V

Your Pip version may vary, but the output format should be as seen in the image below:

Verify you have successfully installed Pip on CentOS

Install Pip on CentOS 7 with Yum

By default, Pip is part of the Extra Packages for Enterprise Linux (EPEL) repository. If you still haven’t enabled the EPEL repository, do so prior to installing Pip.

1. Open the terminal (if you are working locally) or connect to the CentOS 7 server via SSH.

2. To enable the EPEL repository, run the command:

sudo yum install epel-release

3. Confirm the installation by typing y process and wait for the system to complete the task.

4. Before you can download Pip you need to update your packages:

sudo yum –y update

5. Now install Pip with the command:

sudo yum install python-pip

6. Verify the installation with:

pip –V

Note: To see a list of all the pip commands type: pip --help. For examples of how to use them, take a look at some of the essential Pip commands explained.

How to Uninstall Pip on CentOS

Depending on how you installed Pip, there are two ways to remove the software from your system.

If you used curl (the first option), you can delete Pip by running:

sudo pip uninstall pip

Confirm you want to proceed by typing y. The output will display you have successfully uninstalled Pip.

Output showing you have successfully uninstalled Pip from CentOS.

On the other hand, if you installed Pip from the EPEL repository, remove it with:

sudo yum remove python-pip

Press y to verify. You should see a message as in the example below.

screenshot of Remove Pip from CentOS

Conclusion

Great job! You have finished the installation of Pip on CentOS 7.

Pip’s emphasis on code readability and ease of use make it the go-to solution for installing and managing Python software packages.

Was this article helpful?
YesNo
Dejan Tucakov
Dejan is the Head of Content at phoenixNAP with over 8 years of experience in Web publishing and technical writing. Prior to joining PNAP, he was Chief Editor of several websites striving to advocate for emerging technologies. He is dedicated to simplifying complex notions and providing meaningful insight into data center and cloud technology.
Next you should read
How to Install Pip on CentOS 8
August 3, 2020

Pip is a standard package manager for Python which you can use to install additional packages that are not...
Read more
How to Get the Current Date and Time in Python
August 14, 2019

The article shows you how to create a basic Python script that displays the current date and time. Find out...
Read more
How To Upgrade or Update CentOS 7.0/7.1/7.2/7.3/7.4/7.5 to CentOS 7.6
April 5, 2019

CentOS 7.6 is a minor update and was published in December 2018. It includes various minor updates and...
Read more
How to Install Latest Version Of Python 3 on CentOS 7
March 12, 2019

Python is a popular, stable, and well-performing programming language. CentOS 7 uses Python 2.7.5, but as...
Read more