If you are a fan of using Python programming language, you can make your life easier by using Python Pip. It is a package management utility that allows you to install and manage Python software packages easily.

Ubuntu doesn’t come with pre-installed Pip, but here is how you can perform the installation in several simple steps.

Please note that we used the Ubuntu 18.04, but there is no reason why the installation shouldn’t work on other LTS releases. However, we recommend updating your system to the newest version for maximum safety.

What You Need to Install Pip on Ubuntu

Apart from the working and updated Ubuntu OS, you will also need to use the root account of the system. Alternatively, you need a user that has super user permission privileges. In that case, you will need to use the “sudo” command each time you type something in the Linux terminal.

How to Install Python 3 Pip on Ubuntu

Python 3 is the version that comes pre-installed on Ubuntu 18.04, and here is how you can install a suitable Pip.

Start by performing a package list update:

apt update

Now, here is what you should type to install Pip on Ubuntu:

apt install python3-pip

Linux will now perform the installation. You can ensure that the setup went smoothly by inspecting the available Pip version:

pip3 --version

The system will instantly display information about the currently available version on your system.

how to enable python 3 pip on ubuntu

How to Install Python 2 Pip on Ubuntu

If you do not want to use Python 3, you have the option of changing the version to Python 2. Before you do that, you should update the package list:

apt update

Next, type the following line:

apt install python-pip

By utilizing this command, you will tell Linux to install Python 2 and Pip on your system.

Once again, you can check the version to ensure everything went smoothly:

pip --version

how to enable python 2 pip on ubuntu

What You Need to Know about Using Pip on Ubuntu

Using Ubuntu’s package manager to install Python and Pip is the best way to ensure everything will run smoothly on Ubuntu.

It is recommended to utilize a virtual environment to use Pip. There are plenty of things you can do with Pip. If you want to discover the available commands, you can type the following into the terminal:

pip3 --help

You may want to learn more about a particular command. In that case, use the following command:

pip command --help

For example, if you type “install,” the system will display all the relevant info related to installing pip.

what you need to know about using pip on ubuntu

How to Install Pip Packages on Ubuntu

You can easily install different Pip packages on Ubuntu OS. Here is the line that you should use:

pip3 install package_name

You should adjust the “package_name” part and enter the package you want to install.

Use Requirements to Install Packages on Ubuntu

You can create a file that will contain a pip package list with all packages you need to run a particular Python project.

Here is the command you should use to set up a requirement list.

pip3 install -r requirements.txt

Now, let’s take a look at how you can check out all the pip packages currently installed on the system:

pip3 list

If you want to ensure that you have the newest version of a particular package, run this command:

pip3 install --upgrade package

You should change “package” with the name of the package you are upgrading.

The next option to consider is removing a certain package. You can do that by typing the following line”

pip3 uninstall package

IMPORTANT: If you are using Python 2, you should use “pip” instead of “pip3.” That applies for every command mentioned in this guide.

Wrap Up

Python is the programming language of choice of many Linux users out there. Ubuntu has a simplified process of installing pip and managing packages, and we covered some of the basic commands in this article.