How to Install Pip on CentOS 8

Install Pip on CentOS 8

In this article, we will have explained the necessary steps to install and configure Pip on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Pip is a package management system that allows you to install Python packages. With pip, you can install packages from the Python Package Index (PyPI) and other repositories.

Install Pip on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo dnf update

Step 2. Install PIP on CentOS 8.

  • Installing python2-pip

Install pip for Python 2 and all of its dependencies by typing:

sudo dnf install python2-pip

Confirming the installation by printing the pip version:

$ pip2 -V
pip 9.0.3 from /usr/lib/python2.7/site-packages (python 2.7)
  • Installing python3-pip

Install pip for Python 3 and all of its dependencies:

sudo dnf install python3-pip

Confirming the installation by printing the pip version:

$ pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

Step 3. Basic usage of PIP.

  • Basic usage of PIP for python 3

To list all the commands in PIP enter following

pip3 --help

Get information of specific command enter following

pip3 install --help

To search package with PIP enter following

pip3 search PACKAGE_NAME

Install package with PIP enter following in terminal

pip3 install PACKAGE_NAME

To install package from requirements file

pip3 install -r requirements.txt

Upgrade package with PIP

pip3 install --upgrade PACKAGE_NAME

Uninstall package with PIP

pip3 uninstall PACKAGE_NAME
  • Basic usage of PIP for python 2

To list all the commands in PIP enter following

pip --help

Get information of specific command enter following

pip install --help

To search package with PIP enter following

pip search PACKAGE_NAME

Install package with PIP enter following in terminal

pip install PACKAGE_NAME

To install package from requirements file

pip install -r requirements.txt

Upgrade package with PIP

pip install --upgrade PACKAGE_NAME

Uninstall package with PIP

pip uninstall PACKAGE

Congratulation, you have learned how to install and configure Pip on CentOS 8. If you have any question, please leave a comment below.