Open In App

How to Install PIP3 in Linux?

Last Updated : 01 May, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Python, a versatile and widely-used programming language, has a powerful package management system called pip. Pip is used to install and manage Python packages effortlessly. In this article, we will explore the step-by-step process of installing pip3 on a Linux system. While pip is the package installer for Python 2, pip3 is specifically designed for Python 3

PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “on-line repository” termed as Python Package Index (PyPI). pip uses PyPI as the default source for packages and their dependencies. So whenever you type:

pip install package_name

pip will look for that package on PyPI and if found, it will download and install the package on your local system.

How to Install PIP3 in Linux

1. Verify Python Installation

Before installing pip3, it’s essential to ensure that Python 3 is installed on your Linux system. Open a terminal and type the following command:

python3 --version
checking version of python

checking version of python

This command should display the version of Python 3 installed on your system. If Python 3 is not installed, you can install it using your distribution’s package manager.

2. Update Package Manager

Ensure that your system’s package manager is up to date. Use the following commands based on your Linux distribution:

For Debian/Ubuntu-based systems:

sudo apt update
sudo apt upgrade

For Red Hat/Fedora-based systems:

sudo dnf update

3. Install pip3 in Linux

Once Python 3 is installed and the package manager is updated, you can install pip3. Use the following command:

For Debian/Ubuntu-based systems:

sudo apt-get install python3-pip
installing pip3 in linux

installing pip3 in linux

In this pip3 is already installed in Linux that is why it is displaying 0 upgraded , 0 newly installed.

For Red Hat/Fedora-based system:

sudo dnf install python3-pip

4. Verify pip3 Installation in Linux

One can easily verify if the pip has been installed correctly by performing a version check on the same. Just go to the command-line and execute the following command:

pip3 --version

This command should display the installed version of pip3.

Verify pip3 installation in Linux

Verify pip3 installation in Linux

5. Upgrade pip3 (Optional)

It’s a good practice to upgrade pip3 to the latest version. Use the following command:

sudo pip3 install --upgrade pip

This ensures that you have the latest version of pip3 with bug fixes and new features.

Conclusion:

In this guide, we covered the step-by-step process of installing pip3 on a Linux system. Ensuring that Python 3 is installed, updating the package manager, and installing pip3 are essential steps for a smooth installation process. With pip3 installed, you can easily manage and install Python packages for your projects.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads