How to instructions for installing PIP on Centos 7

Estimated reading: 3 minutes 0 views

I. Introduction

What is PIP?

PIP is a package management system that simplifies the installation and management of software packages written in Python, such as those found in the Python Package Index ( PyPI ).). PIP is not installed by default on CentOS 7, but the installation is pretty straightforward.

In this tutorial, We will walk you through the steps required to install PIP on CentOS 7 using the package manager and cover some basics on how to install and manage Python packages using PIP.

When installing python modules, you should give preference to installing the python modules provided by your distribution  yum as they are tested to work properly on CentOS 7. In most cases, you should just use PIP in a virtual environment. Python  Virtual Environmentsallows you to install Python modules in an isolated location for a specific project, rather than being installed system-wide. This way you don’t have to worry about affecting other Python projects.

So, specifically, how to install and use it, please continue to see part II.

II. Installation Instructions

To install PIP on Centos 7 you can install it with the following 2 steps.

Step 1: SSH into your VPS

First you need to SSH into your VPS with Root privileges

Step 2: Install PIP and use PIP

1. Activate the EPEL Kho Warehouse 

By default PIP is not available in CentOS 7 repositories. To install PIP, we need to enable EPEL repository with command.

yum install epel-release

2. Install PIP

Once the EPEL repository is enabled, we can install PIP and all its packages with the following command:

yum install python-pip

3. Test PIP

After successful installation, you use the following command to check the version of PIP and Python installed.

pip --version
Instructions for installing PIP on Centos 7

So my VPS has installed PIP 8.1.2 and Python 2.7

4. Install development tools

Development tools are required to build Python Modules, you can install them as follows.

yum install python-devel
yum groupinstall 'development tools'
Instructions for installing PIP on Centos 7

5. Manage Python Packages with PIP

First, to be able to see some instructions on how to use PIP, you can use the command

pip help
Instructions for installing PIP on Centos 7

Next, we’ll go over a few useful basic PIP commands. With PIP we can install packages from PyPI, version control, local projects and from distribution files. Normally you would install packages from PyPI.

Install the package.

If the old version of pip does not work, you can Update it with the command:

pip install --upgrade pip==20.3

Suppose we want to install a package named  twisted, we can do that with the following statement.

pip install twisted

twist is an asynchronous networking framework written in Python.

Uninstall the package

To uninstall a run package then you can use the following corresponding command.

pip uninstall twisted

Upgrade package

To upgrade the package, then you can use the following corresponding command.

pip install --upgrade

Package Search

To search for packages from PyPI you can use the following corresponding command.

pip search "twisted"

List installed packages

To list installed packages then you can use the following corresponding command.

pip list

List outdated and obsolete packages.

To list outdated packages, you can use the following corresponding command.

pip list --outdated

So you can grasp the basic commands to manage Python with PIP already.

III. Summary

Thus, in this article, We has shown you how to install PIP on a server using Centos 7 complete with just a few simple command lines. Installing PIP will help you easily manage Python and bring efficiency in the operation and use of your VPS . Hope this article will help you to install successfully.!

Support 24/24h with coupon code: 1DOLLAROFF 10% discount. Click now! 👆

Leave a Comment