Ubuntu

How to Install pip on Ubuntu 24.04

Ubuntu is a preferred Linux distribution, especially for programmers and developers. When using Ubuntu 24.04, you must know how to install pip. As a Python developer or user, pip is a Python package manager that allows you to install and manage Python packages for your projects. Besides, when installing a package that requires some dependencies, you might require pip to help install them.
Installing pip on Ubuntu 24.04 is straightforward. With only a few commands, you will have pip installed and ready for use. This post shares all the details you should know regarding installing pip.

How to Install pip on Ubuntu 24.04

Different circumstances make installing pip on Ubuntu 24.04 a must-know for everyone. If you are a Python developer using Ubuntu 24.04, you inevitably need pip to install and manage Python packages.
As a regular Ubuntu 24.04 user, pip helps install package dependencies and is the recommended approach for installing packages by sourcing them from indexes such as PyPI.
It’s worth mentioning that Python has two flavors, but for this example, we are focused on installing pip for Python3.
Besides, Python3 is the latest flavor and is recommended for any Python activity. For Python 3 packages, including pip, they will have the ‘python3-’ prefix before their name.
Below are the steps to follow to install pip on Ubuntu 24.04
Step 1: Update the Ubuntu 24.04 Package List
Before installing pip on Ubuntu 24.04, we must update the package list. Doing so helps refresh the sources list, allowing us to access the recent pip version.
Run the update command below.

$ sudo apt update
install-pip-ubuntu-24.04

You will get prompted to enter your password to run the apt command, as it is an administrative task that requires sudo privileges. Once you enter the password, allow the process to complete.

Step 2: Install Python3 pip
Ubuntu 24.04 has pip in its repository. Since we want to install pip for Python3, not Python2, we must specify it when running the install command.
Here’s how you install pip.

$ sudo apt install python3-pip
install-pip-ubuntu-24.04

Once you run the command, it will execute and fetch the pip package and its dependencies. Once the process is complete, you will have managed to install pip on your Ubuntu 24.04.
Step 3: Verify the Installation
Although we’ve successfully installed pip on Ubuntu 24.04, we still need to verify the installation. One way to do this is to check the installed pip version.
The command below will return the pip version if installed.

$ pip3 --version

We’ve installed pip 24.0 for this guide.

install-pip-ubuntu-24.04

How to Use pip on Ubuntu 24.04

After installing pip, the next task is to understand how to use it for different tasks. Like other packages, pip also has a help page where you will view all the various options and their descriptions.
To access the help page, execute the below command.

$ pip3 --help
install-pip-ubuntu-24.04

You will get an output showing the available options alongside their descriptions. Go through the output to understand the different actions you can take when running pip.
For instance, if we want to see the different packages installed on our system, we can list them using the below command.

$ pip3 list

We then get an output showing the available packages and a brief description of the version.

install-pip-ubuntu-24.04

Feel free to explore how to use pip more, depending on your project needs.

Conclusion

pip is a reliable Python package manager. With pip, you can install and manage Python packages with ease, offering convenience in installing project dependencies. To install pip, specify what Python flavor to use, and then run the install command. This post focuses on installing Python3-pip, and we’ve given the steps to follow, from installing pip to giving an example of how to use it.

About the author

Denis Kariuki

Denis is a Computer Scientist with a passion for Networking and Cyber Security. I love the terminal, and using Linux is a hobby. I am passionate about sharing tips and ideas about Linux and computing.