How to Install Pip on CentOS 7?
Linux-based distribution CentOS 7 is preferred by many users. Most programmers prefer command-line OSes over GUIs, and CentOS 7 is one of the most popular command-line systems. Often, you will need to work in more than one language as a programmer. A good example of this is Python.
If you are a Python user, you must be aware about the various Python packages which you require and can easily download. The Python Package Index is the web repository of public Python packages, which is quite large. You might find downloading, maintaining, and updating these packages challenging.
What you need here is Pip- Pip Install packages. It is a system written in Python which installs and manages software packages for it. It makes the installation and management easy as it is connected to the online repository.
Packages contain every tool, file, and dependency you need to run a module, and modules are the heart of Python packages. Pip becomes even more useful as a result.
You may be wondering how to install pip on CentOS 7 if you are running a particular version of Python. Pip is simple to install, and a few commands will do it for you.
This guide contains commands to install, upgrade, downgrade, and use pip on your CentOS 7 system.
Installing pip On CentOS 7
There are two answers to the question of how to install pip on CentOS 7 as you can install it in two ways. One more thing you must know here. Pip is already installed for Python 2 series (version 2.79 or higher) and Python 3 series (version 3.4 or higher). If your system is running a version other than these, the commands mentioned below will be useful for you.
Before we dive into How to install pip on CentOS 7, you must check if your system has pip installed.
Following the command will help you check it.
python -m pip – – version
How to install pip on CentOS 7?
There are two methods to install pip on CentOS 7-
- Using Curl and Python
- Using Yum
Installing Pip With Curl and Python in the following steps-
- Go to the official repository and download the package with <strong> curl <strong> command.
curl “https://bootstrap.pypa.io/get-pip.py” -o “get-pip.py”
- Install pip using the command-
sudo python get-pip.py
- Confirm the installation-
- Depending on your Python version, your pip version will vary but the output will look something like-
[sofija@localhost ~]$ pip -V
pip 20.0.2 from /usr/lib/python2.7/site-packages/pip (python 2.7)
Installing with Yum
You can also install pip on CentOS 7 with Yum. Follow the steps-
- Enable the epel repository with following
sudo yum install epel-release
- Now update your package-
sudo yum –y update
- Install pip with yum
sudo yum install python-pip
It was easy, wasn’t it? But it doesn’t end here.
Upgrading Pip On CentOS 7
Once you have installed pip on your CentOS 7 system, you may need to upgrade it with time. It is very simple and the following command will work for you.
python -m pip install -U pip
The command will do.
Downgrading Pip On CentOS 7
If an upgrade goes wrong or it limits a functionality, the need to downgrade the present version to an earlier one may arise. Execute-
python -m pip install pip==18.1
Using Pip On CentOS 7
So you’ve installed pip, but how can you use it? How do I install a package with it? You can use the following command to search for and install Python packages.
Search any package with-
pip search QUERY
Install package with-
pip search <package name>
Upgrade package with-
pip install – – upgrade <package name>
Remove a package with-
pip uninstall <package name>
Python is a powerful language with a lot of functionality. This language is used not only for designing programs or applications, but also for web development, software development, backend applications, etc.
That’s why programmers love it. In order to perform most of the functionality, modules must be found in packages on Python’s online repository. Installing these packages is easy with Pip.
Installing pip on CentOS 7 takes just a few seconds by using the commands below. Pip can be installed on various operating systems, including Ubuntu, Windows, and CentOS. It is not a complicated operation.
This guide is a comprehensive guide for installing, upgrading, downgrading and using pip for package installation. So, how to install pip on CentOS 7 is no longer a problem for you, right?