How to install PIP on CentOS 8?

Overview

For the Python programming language, there is a package management called pip. Python plugins and other software packages can be installed more quickly and easily with the help of pip.

There are two versions: a legacy version for Python 2 and the most recent version, which is for Python 3.

This tutorial will demonstrate how to set up pip on CentOS 8 for Python 2 and Python 3.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • A machine running CentOS 8

  • A root user having Sudo privileges

  • Internet connection

Get Started

a. pip installation for Python 3

The most recent, reliable, and continuously maintained version of Python is Python 3. Python 3 is advised if you don't really need Python 2 for backward compatibility with older programmes.

Step 1: Updating the system repositories

Open a terminal window, and then type the following command to update the system repositories:

sudo yum update

This will update the local list of software packages. Updates may take a while to install if yum update hasn't been executed recently.

Step 2: Installing Python 3

Python 3 is a standard feature in several CentOS 8 updates. Skip this step if Python 3 is already installed on the system.

Open a terminal window and type the following command to install Python 3:

sudo yum install python3

Step 3: pip Installation for Python 3

For Pip installation for Python 3, open a terminal and type the following:

sudo yum install python3-pip

Step 4: Verify pip has been installed

Verifying an application's version number is one approach to see if it has been installed. Enter the following command to determine the Pip 3 version.

pip3 --version

The pip3 version that is installed on your system is shown in the output.

b. pip Installation for Python 2

You may install different Python versions simultaneously with CentOS 8. Python 2 may be set up concurrently with Python 3 installations.

Step 1: Updating the system repositories

Continue to the following step if you updated the repositories in the previous section.

Use the following command to update repositories:

sudo yum update

Step 2: Installation of Pip 2

For Pip 2 installation, open a terminal and type the following:

sudo yum install python2-pip

Step 3: Verify the installation

To ensure that pip2 is installed on your Centos 8 system, check its version:

pip2 --version

The pip2 version should be visible on the system.

Conclusion

Your CentOS 8 system has Pip installed for Python 2 and Python 3. Pip may be used to conveniently manage the most well-liked Python packages.

Last updated