Categories: TutorialsUbuntu

How to install pip on Ubuntu 18.04 or Ubuntu 20.04

PIP is a utility that manages software packages such as libraries and dependencies for the development modules of Python. In this short tutorial, you will learn how to install pip on Ubuntu 18.04 or 20.04.

Installation steps

While Python 3 is installed by default on Ubuntu 18.04 or Ubuntu 20.04 and similar distributions, PIP is not.

In order to install pip, run the commands below:

sudo apt update

Sponsored

sudo apt install python3-pip

Install pip3 Ubuntu

Once the installation is completed, you may want to check the version of PIP by invoking the command:

pip3 –version

In order to obtain the latest version of pip, simply issue the command below:

sudo pip3 install –upgrade pip

How to start using PIP

In the section below, you will learn some commands on how to use PIP.

Software packages installation

The installation of the latest version of a given software package can be achieved by running the command below :

sudo pip3 install PackageName

Pip can also upgrade a software package to the most recent version using the command:

sudo pip3 install –upgrade PackageName

For instance, we want to upgrade the package idna :

Sponsored

Software package uninstallation

To uninstall a package, invoke the command below:

sudo pip3 uninstall PackageName

Read: How to install and uninstall applications on Ubuntu, A Beginner’s guide

PIP Packages listing

To see the list of all Pip packages that are installed, run the command:sudo pip3 list

Package search

To look up a specific package, run the command:

sudo pip3 search SearchCriteria

For example:

Outdated packages list

To see the outdated packages, run the command (it may take some time since it needs to remotely compare the current versions with the latest ones ):

sudo pip3 list –outdated

Read: How to Install PIP on Windows

To obtain more details about a given package, simply run the command :

sudo pip3 show PackageName

See example below with the package idna :

Bonus section: How to upgrade Python on Ubuntu

In case you would like to upgrade or update your current Python on Ubuntu, run the commands below on your terminal (example below applies to an upgrade to Python 3.7) :

sudo apt-get update
sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
sudo apt-get install python3-pip python3.7-dev
sudo apt-get install python3.7

In case the repository is not available or you get  package not found error, invoke the commands below:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update

The post How to install pip on Ubuntu 18.04 or Ubuntu 20.04 appeared first on net2.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago