This tutorial will teach you how to install pip3, the package manager for Python, on Ubuntu Linux.
Pip is a Python Package Manager. It’s currently at version 3 – hence, Pip3.
Python is useful on its own, but it’s even more useful when you can start leveraging other people’s pre-written code.
The default repository used by Pip is the Python Package Index (PyPI) (https://pypi.org/). PyPI contains a collection of other users’ code for performing a multitude of tasks, from drawing graphs to artificial intelligence.
Checking if Pip is Already Installed
To check if pip is installed, you can check the version installed on your Ubuntu system by running the following in the terminal:
If it is installed, you’ll see something like:
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
If it is not, you can install it by running the following in your terminal:
sudo apt update sudo apt install python3-pip
You can list out all of the available functions in Pip from the terminal:
Listing Installed Pip Packages
To see what Pip Packages are already installed on your system:
Installing Python Packages with Pip
To install a package, you’ll need to know the name of the package. You can search for packages online in the PyPI package database at https://pypi.org :
pip3 install smpl
Above, we installed the smpl graphing package.
Installing a Specific Package Version
Install a specific version of a package (often done for compatibility reasons):
pip3 install smpl==0.0.4.0
Upgrade an Already Installed Package
Update a package you already have installed on your system:
pip3 install --upgrade package-name
Finally, you can completely remove a package from your system using Pip:
pip3 uninstall package-name