PIP is a package management system used for installing and managing software packages that were developed with Python. The objective of this tutorial is to show the reader how to install PIP on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to install Python package installer PIP
- How to install Python 3 package installer PIP3
- Basic PIP command usage
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Install Python package installer PIP on Ubuntu 20.04 step by step instructions
Before you proceed make sure that you have the Ubuntu Universe repository enabled as otherwise the below python-pip installation commands will throw the following error: E: Unable to locate package python-pip
- Depending on your needs you may install both Python and Python 3 PIP versions using the following commands:
PYTHON 2: $ sudo apt install python-pip PYTHON 3: $ sudo apt install python3-pip
- Confirm the successful installation by checking for the
pip
andpip3
version:$ pip --version pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7) $ pip3 --version pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
- Use the PIP command to installed python libraries. Here is a basic usage:
The following lines will illustrate a basic usage and syntax of PIP command. To search packages index execute:$ pip search KEYWORD
Once you obtain the package name use pip to install it:
$ pip install PACKAGE_NAME
Lastly, to remove package enter:
$ pip uninstall PACKAGE_NAME