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.
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.
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.
We’ve installed pip 24.0 for this guide.
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.
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.
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.
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.
One of the most critical gaps in traditional Large Language Models (LLMs) is that they…
Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…
What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…
Wouldn’t it be wonderful to wake up one day with a desire to explore AI…
Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…
Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…