How To Install and Uninstall Python Pip on CentOS 8
Pip is a Python packages, modules management. It provides commands to manage, upgrade, and uninstall packages easily. By default, it is not installed on CentOS operating system. Therefore, this tutorial will show you how to install Python Pip in CentOS 8. There are many ways to achieve it, choose a one you think is easy. This tutorial also helps you to uninstall Python Pip.
Prerequisites to install Python Pip
- Operating system: a Linux machine - CentOS 8 or newer with 2GB RAM (4GB preferable)
- You are logging a user account with sudo privileges
Installing Python Pip on CentOS 8
Step 1: Add the EPEL Repository
The CentOS 8 core repositories do not have Pip. EPEL or Extra Packages for Enterprise Linux is a community repository of non-standard packages for the Red Hat Enterprise Linux (RHEL) distribution. As a result, we must allow the EPEL repository in order to install Pip.
sudo yum install epel-release
Step 2: Install Python Pip
Once the EPEL repository is enabled we can now update our packages, install pip and all of its dependencies with the following commands:
sudo yum -y update
sudo yum -y install python-pip
Step 3: Verify the installation
After executing the above command, to make sure that Python Pip is installed on your CentOS 8, we must use this command to check:
pip -V
If the output result same as this, it means you installed Pip on CentOS correctly.
pip 21.3.1 from /usr/lib/python3.8/site-packages (python 3.8)
Install Pip using cURL and Python
cURL, which stands for client URL, is a command-line tool that developers use to transfer data to and from a server. Therefore, you can download files from the internet while using the terminal. Combining with Python which I mentioned in Tutorial install Python, you can install Pip on CentOS very easily.
Step 1: Download Pip from the Internet
Pip is code script written in the Python programming language, so it is possible to install Pip on CentOS 8 by downloading and using Python to install. In order to download Pip, we will use this Linux command:
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
You can also go to this download page to get it.
Step 2: Using Python to install Pip
After you have downloaded the file above, change the directory to the directory where the file is located, and use python
to install it. If you have not installed Python, you can refer to the tutorial I mentioned above.
python get-pip.py
After the installation is complete, don’t forget to check again if Pip has been installed correctly, you can refer to step 3 above.
Uninstall Python Pip on CentOS 8
After you’ve installed Pip, if you don’t want to continue using it for some reason, uninstalling Pip is a must to keep your Linux OS clean. To Uninstall Pip on CentOS, you can follow this command:
pip uninstall pip
Conclusion
This tutorial helped you to install Python Pip on CentOS 8 system. Check out the pip user handbook for more information. Please leave a remark below if you have any feedback. Hope to see you in next posts :)