29.9 C

How To Install Pip on Ubuntu 20.04

Today we are going to learn that how to install Pip on Ubuntu 20.4. Pip is used like apt to get packages from Python Package Index. So as you get packages by apt package manager as the same way you can get from pip but for Python. So, in this tutorial you’ll learn the steps to cover the installation of pip on Ubuntu 20.04.

Step 1: Update Your System

First of all before going to install any package, update your system with the command.

sudo apt update

Step 2: Install Pip for Python3 on Ubuntu 20.04

As Python3 is already installed on Ubuntu 20.04, to make sure verify the version by using the following command.

- Advertisement -
python3 --version


You’ll see the similar output.

sabi@Ubuntu:~$ python3 --version
Python 3.8.2

After confirming that Python3 is present on your Ubuntu 20.04, move towards the installation of pip package for installing Python3 pip packages. Type the given command into your terminal.

sudo apt install -y python3-pip


Setting up python3-pip (20.0.2-5ubuntu1) ... Setting up libc6-dev:amd64 (2.31-0ubuntu9) ... Setting up binutils-x86-64-linux-gnu (2.34-6ubuntu1) ... Setting up libstdc++-9-dev:amd64 (9.3.0-10ubuntu2) ... Setting up binutils (2.34-6ubuntu1) ... Setting up dpkg-dev (1.19.7ubuntu3) ... Setting up libexpat1-dev:amd64 (2.2.9-1build1) ... Setting up libpython3.8-dev:amd64 (3.8.2-1ubuntu1.1) ... Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-2ubuntu1) ... Setting up gcc-9 (9.3.0-10ubuntu2) ... Setting up libpython3-dev:amd64 (3.8.2-0ubuntu2) ... Setting up gcc (4:9.3.0-1ubuntu2) ... Setting up g++-9 (9.3.0-10ubuntu2) ... Setting up python3.8-dev (3.8.2-1ubuntu1.1) ... Setting up g++ (4:9.3.0-1ubuntu2) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) i n auto mode Setting up build-essential (12.8ubuntu1) ... Setting up python3-dev (3.8.2-0ubuntu2) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for libc-bin (2.31-0ubuntu9) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for desktop-file-utils (0.24-1ubuntu2) ... 

After the installation completed, verify the version of pip using the following command.

pip3 --version


You’ll see the output similar to this one.

sabi@Ubuntu:~$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

So, as we’ve installed the pip successfully now we’ll learn that how we can use pip to get Python packages on Ubuntu 20.04.

Step 3: How To Use Pip on Ubuntu 20.04

Below is the format you can use in order to install the package with the help of Pip command.

pip3 install package-name

In this case I’m going to install IPython on my Ubuntu 20.04 system so the command will be like this.

pip3 install IPython

Successful output;

Successfully built backcall
Installing collected packages: decorator, pygments, parso, jedi, pickleshare, wcwidth, prompt-toolkit, ipython-genutils, traitlets, backcall, IPython
WARNING: The script pygmentize is installed in '/home/sabi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts iptest, iptest3, ipython and ipython3 are installed in '/home/sabi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed IPython-7.13.0 backcall-0.1.0 decorator-4.4.2 ipython-genutils-0.2.0 jedi-0.17.0 parso-0.7.0 pickleshare-0.7.5 prompt-toolkit-3.0.5 pygments-2.6.1 traitlets-4.3.3 wcwidth-0.1.9

You can mention the version name if you want to install the specific version of the packages with the help of following command.

pip3 install IPython==6.0

Step 4: Find installed Pip Packages

Simply fire the follwoing command to get list of the installed packages using pip.

pip3 list


You’ll see the similar output.

abi@Ubuntu:~$ pip3 list
Package Version

apturl 0.5.2
backcall 0.1.0
blinker 1.4
Brlapi 0.7.0
certifi 2019.11.28
chardet 3.0.4
command-not-found 0.3
cryptography 2.8
cupshelpers 1.0
dbus-python 1.2.16
decorator 4.4.2
defer 1.0.6
distro 1.4.0
distro-info 0.23ubuntu1
entrypoints 0.3
httplib2 0.14.0

Step 5: How to Upgrade Packages with Pip

For upgrading of the installed package run the following command.

pip3 install --upgrade IPython

So, it will upgrade the package to latest one.

Step 6: How To Remove Packages using Pip

In order to remove any package installed with pip, hit the given command in your Ubuntu 20.04 terminal.

pip3 uninstall IPython

Step 7 How To Search Packages with Pip

With the help of Pip you can search the different packages for your convenience. It provides you the available packages from the PyPI. Run the command in similar way to search for packages.

pip3 search zabbix


abi@Ubuntu:~$ pip3 search zabbix
zabbix (1.2.4) - Python module to work
with zabbix.
zabbix-tuner (0.2) - Zabbix Tuner
zabbix-api (0.5.4) - Zabbix API
zabbix-multisender (0.4.7) - Zabbix MiltiSender
zabbix-client (0.1.2) - Zabbix API wrapper
zabbix-elasticsearch (0.4.0) - Zabbix Monitoring for
flask-zabbix (0.1.1) - Zabbix API wrapper
dbaas-zabbix (0.7.2) - A Zabbix Integration for
waldur-zabbix (0.8.4) - Waldur Zabbix adds
support for Zabbix
monitoring server
nodeconductor-zabbix (0.6.0) - NodeConductor Zabbix adds
support for Zabbix

So, this is how you can install and use Pip on Ubuntu 20.04

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article