How to install Pip in Ubuntu

Linux has a lot of package managers. Ubuntu not only has apt but also many programming languages ​​that come with its own package manager. Pip stands for Python Packages Packages and allows you to easily install packages from Python Package Index (PyPI).

Linux has a lot of package managers. Ubuntu not only has apt but also many programming languages ​​that come with its own package manager. Node.js has npm, Ruby has a gem and Python has pips.

Pip stands for Python Packages Packages and allows you to easily install packages from Python Package Index (PyPI). You can also use pip to install from other indexes, but most of what you need will usually be available on PyPI. To use pip for installing packages, you first need to install this tool on your system.

Instructions for installing Pip in Ubuntu

  1. Which version of pip do you need?
  2. How to install pip for Python 3
  3. How to install pip for Python 2
  4. Should I use pip or Apt?

Which version of pip do you need?

If you are completely familiar with Python, you probably know that Python 3 has been around for a long time. However, due to major changes between Python 2 and Python 3, many Linux distributions include both versions by default. Therefore, pip also has 2 versions.

The newer Ubuntu versions only come with Python 3 installed by default. If you need pip for Python 2, you will also need to install Python 2.

Which version you need depends on the package you want to install. But anyway, this process is relatively easy. Today's article will show you how to install both versions.

How to install pip for Python 3

The first thing to do before you start is to make sure the package list has been updated. Do this by running apt:

 sudo apt update 

This process will take some time. When completed, you can switch to the actual pip setting. To do this, run the following command:

 sudo apt install python3-pip 

How to install Pip in Ubuntu Picture 1How to install Pip in Ubuntu Picture 1

Confirm that you want to install the packages and wait for the process to complete. When this is done, confirm that the installed package is correct by checking the version:

 pip3 --version 

How to install Pip in Ubuntu Picture 2How to install Pip in Ubuntu Picture 2

How to install pip for Python 2

As mentioned above, if you need pip for Python 2, you also need to install Python 2. However, this is easy because Python 2 will be installed as a dependency for pip.

First, make sure the package list is updated:

 sudo apt update 

When this is done, you can install pip by the following command:

 sudo apt install python-pip 

How to install Pip in Ubuntu Picture 3How to install Pip in Ubuntu Picture 3

Confirm that you want to install pip and its dependencies, then wait for the installation process to complete. When this is over, make sure everything is installed correctly by checking the version:

 pip --version 

How to install Pip in Ubuntu Picture 4How to install Pip in Ubuntu Picture 4

Should I use pip or Apt?

In some cases, you'll see that packages are available in both Python Package Index and through Apt. If you have to choose, you should stick with the installation via Apt, since these versions have been tested to work on Ubuntu. In most cases, you will only want to use pip if the package is not available via Apt or if you need a specific version.

Please note that you may need to install pip for both Python 2 and Python 3. Some packages are only available for certain python versions and other software may have either version or both. For example, Neovim allows users to create add-ons in both Python 2 and Python 3, based on having a separate package installed in both pip versions.

If you are a developer, chances are you have installed pip. If this is the case, take the time to review the list of TipsMake.com 's best Python IDE's .

Hope you are succesful.

5 ★ | 2 Vote