How To Install Python pip On Ubuntu 18.04

This comprehensive Linux guide expects that you run the following commands as root user but if you decide to run the commands as a different user then ensure that the user has sudo access and that you precede each of the privileged commands with sudo

pip is a standard package-management system used to install and manage software packages written in Python. Many packages can be found in the default source for packages and their dependencies — Python Package Index. Most distributions of Python come with pip preinstalled.

In this tutorial, we will guide you about how to install Python pip on your Ubuntu 18.04 system. Follow the instructions below.

Updating Packages Repository Database

Before installing pip on your Ubuntu 18.04, you need to update your yum repository cache by running the following command

root@codesposts:~$ apt update

Installing pip

Now, run the following command to install Python pip on your system.

root@codesposts:~$ apt install python-pip

Verifying The Installation

You can verify the version of the pip installed on your system by running the following command.

root@codesposts:~$ pip --version

pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Installing Python3 pip

If you want to install the Python3 pip instead of the Python2 pip, you can run the command below

root@codesposts:~$ apt install python3-pip

Verifying The Version

Run the following command to verify the version of pip3 installed on your system.

root@codesposts:~$ pip3 --version

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

Installing Packages Using pip

To install a package using the pip, run the command like below

root@codesposts:~$ pip install twitter
OR
root@codesposts:~$ pip3 install twitter

Replace the “twitter” with the package name you want to install.

Displaying All Installed Packages

You can display the list of all the packages installed on your system using pip by running the command below

root@codesposts:~$ pip list

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
asn1crypto (0.24.0)
colorama (0.4.1)
configobj (5.0.6)
cryptography (2.1.4)
enum34 (1.1.6)
idna (2.6)
ipaddress (1.0.17)
IPy (1.0)
keyring (10.6.0)
keyrings.alt (3.0)
pip (9.0.1)
pycrypto (2.6.1)
pyfiglet (0.8.post1)
pygobject (3.26.1)

Removing A Package

If you want to remove a package, you can run the command below

root@codesposts:~$ pip uninstall twitter

Replace the “twitter” with the package name you want to install.

The post How To Install Python pip On Ubuntu 18.04 appeared first on CODESPOSTS.COM.

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…

5 days ago

Ubuntu Weekly Newsletter Issue 887

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

6 days ago