Categories: 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

Sponsored

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

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

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.

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.

Sponsored
$ pip3 –help

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.

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.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

15 hours ago

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…

2 days ago

What is patching automation?

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

3 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…

4 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…

4 days ago

Ubuntu Weekly Newsletter Issue 870

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

4 days ago