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.

Sponsored

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

Sponsored

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

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

17 hours ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

3 days ago

Get Valkey security patching and support with Ubuntu Pro

Canonical is pleased to announce security patching and support for Valkey through the Ubuntu Pro…

4 days ago