• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Pip on CentOS 8

Written by Admin, Updated On April 30, 2020
centos, pip
How to Install Pip on CentOS 8

Pip is a standard package management tool used for installation of packages in Python. Using pip, you can search, download and install packages from Python Package Index (PyPI) and other repositories. This tutorial explains how to install Pip on CentOS 8.

Installing pip on CentOS 8#

There are two Python versions currently, Python 2 and Python 3. CentOS 8 repository allows access to both pip versions for Python 2 as well as Python 3 interpreter. On CentOS 8, you can install packages either with dnf or yum command. We can install pip2 or pip3 package depending on what python version we use, or we could also install both packages as well, without any problem.

Installing pip for Python 3 (pip3)#

Open your terminal on your CentOS and run the below command as root or sudo user to install pip for Python 3:

sudo dnf install python3

The above command will install Python 3.6 and pip. To verify that pip is installed perfectly, type:

pip3 --version

This will print the pip version. It may vary depending when you are installing.

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

Next, you should install the development tools to install and build python modules with pip. Run the below commands:

sudo yum install python3-devel
sudo yum groupinstall 'development tools'

Installing pip for Python 2 (pip2)#

Run the following command to install Python 2 and pip:

sudo dnf install python2

Verify the installation by typing:

pip2 --version

It show show something like below:

Python 2.7.15

Same as Python 3 you need to install development tools:

sudo yum install python2-devel
sudo yum groupinstall 'development tools'

Manage Python Packages with pip#

Here, we will see examples how to use pip commands.

Below is the syntax to install package with PIP:

pip install PACKAGE_NAME

For example, to install names python package, run below command:

pip install names

names is a package which will return random names.

You can uninstall a package use pip uninstall followed by the package name:

pip uninstall PACKAGE_NAME

To search package using PIP just type as below:

pip search PACKAGE_NAME

Get the list of installed packages using below command:

pip list

The list of outdated packages can be retrieved by:

pip list --outdated

You can upgrade already installed packages to latest version using below command:

pip install --upgrade PACKAGE_NAME

Conclusion#

This tutorial shown you how to install Pip on CentOS 8. Also, described how to manage Python packages using pip. You can get more details about pip from this guide.

To ask any question, feel free to leave a comment.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Go on Ubuntu 20.04
Next Article   How to Install Git on Ubuntu 20.04 (Focal Fossa)

Related Posts

  • How to Install Php 8 on CentOS 8

    How to Install PHP 8 on CentOS 8

    January 27, 2021
  • How to Install Python 3.9 on CentOS 8

    How to Install Python 3.9 on CentOS 8

    December 31, 2020
  • How to Install GIMP 2.10 on CentOS 8

    How to Install GIMP 2.10 on CentOS 8

    December 30, 2020

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install SSH Keys on Ubuntu 22.04
    How to Set up SSH Keys on Ubuntu 22.04 January 7, 2023
  • How to Install Mongodb on Debian 11
    How to Install MongoDB on Debian 11 Linux January 11, 2023
  • How to Install Puppet Agent on Ubuntu 22.04
    How to Install Puppet Agent on Ubuntu 22.04 January 22, 2023
  • How to Install Python 3.11 on Debian 11
    How to Install Python on Debian 11 January 25, 2023
  • How to Change-Hostname Ubuntu 22.04
    How to Change Hostname on Ubuntu 22.04 January 19, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook