> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Install Pip on Ubuntu
- URL: https://itsfoss.com/install-pip-ubuntu/
- Published: 2018-10-01T14:14:44.000Z
- Updated: 2023-06-02T12:58:18.000Z
- Description: Pip is a command-line tool that allows you to install software packages written in Python. Learn how to install Pip on Ubuntu and how to use it for installing Python applications.
- Author: Abhishek Prakash
- Tags: Ubuntu

📜

**Summary**: To install PIP on Ubuntu, you should make sure to enable universe repository and then install `python3-pip` package like this:  
  
**sudo add-apt-repository universe**  
**sudo apt install python3-pip**

There are numerous ways to [install software on Ubuntu](https://itsfoss.com/remove-install-software-ubuntu/). You can install applications from the software center, from downloaded deb files, from PPAs, from [Snap packages](https://itsfoss.com/use-snap-packages-ubuntu-16-04/), [using Flatpak](https://itsfoss.com/flatpak-guide/), using [AppImage](https://itsfoss.com/use-appimage-linux/) and even from the good old source code.

Here’s another way to install packages on [Ubuntu](https://www.ubuntu.com/?ref=itsfoss.com). It’s called PIP and you can use it to install Python-based applications.

## What is pip?

[Pip](https://en.wikipedia.org/wiki/Pip%5F%28package%5Fmanager%29?ref=itsfoss.com) stands for “Pip Installs Packages”. [Pip](https://pypi.org/project/pip/?ref=itsfoss.com) is a command-line based package management system. It’s used to install and manage software written in the [Python language](https://www.python.org/?ref=itsfoss.com). You can use pip to install packages listed in the Python Package Index ([PyPI](https://pypi.org/?ref=itsfoss.com)).

**As a software developer**, you can use pip to install various Python modules and packages for your own Python projects.

**As an end user**, you may need pip for installing some applications that are developed using Python and can be installed easily using pip. One such example is the [Stress Terminal](https://itsfoss.com/stress-terminal-ui/) application, which you can easily install with pip.

Let’s see how you can install pip on Ubuntu and other Ubuntu-based distributions.

## How to install pip on Ubuntu, Linux Mint and other Ubuntu-based distributions

🚧

Python 2 is deprecated in Ubuntu 20.04 and higher versions. You can only install PIP3\. Though Python2 is available on the Universe repo of Ubuntu 22.04, you should not use it.

First, make sure that Python 3 is installed on Ubuntu. To check that, use this command:

```
python3 --version
```

If it shows you a number like Python 3.x.y, Python 3 is installed on your Linux system.

![Checking the version of Python Installed on Ubuntu](https://itsfoss.com/content/images/2023/05/python3-version-in-Ubuntu.png)

Python3 Version

Now you can install pip3 using the command below:

```
sudo apt install python3-pip
```

You should verify that pip3 has been installed correctly using this command:

```
pip3 --version
```

It should show you a number like this:

```
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
```

This means that pip3 is successfully installed on your system.

![Installing Pip using terminal](https://itsfoss.com/content/images/2023/05/install-pip.svg)

Install Pip

💡

`pip` command defaults to pip3 in Ubuntu 20.04 and above.

## Installing Python packages \[Recommended Way\]

Recently, a change has been done on distributions like Ubuntu 23.04 and upcoming Debian 12, regarding the [installation of python packages](https://itsfoss.com/externally-managed-environment/). 

From now on, you should install Python packages either from native repositories, install in a virtual environment or use `pipx`.

[Externally Managed Environment Error With Pip in UbuntuSeeing an “externally managed environment” error while using Pip in Ubuntu 23.04? Here’s what you can do about this error.![](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)It's FOSSAbhishek Prakash![](https://itsfoss.com/content/images/2023/05/handling-externally-managed-env-pip.png)](https://itsfoss.com/externally-managed-environment/)

This was implemented to avoid the conflict between OS package managers and Python-specific package management tools like pip. These conflicts include both Python-level API incompatibilities and conflicts over file ownership.

## Using pip commands

Now that you’ve installed pip, let’s quickly see some basic pip commands. These commands will help you use pip commands for searching, installing and removing Python packages.

🚧

As mentioned above, newer releases like Ubuntu 23.04 and Debian 12, will throw error, if you try to install Python packages in the method mentioned below.

### Install a package with pip

There are two ways to install a package with PIP. You either install it for the currently logged-in user, or you install system-wide.

If you use `--user` option, it installs the package for the logged-in user, i.e., you, without needing sudo access. The installed python software is available only for you. Other users on your system (if any) cannot use it.

```
pip3 install --user python_package_name
```

If you remove the `--user` option, the package will be installed system-wide, and it will be available for all the users on your system. You’ll need sudo access in this case.

```
sudo pip3 install python_package_name
```

![Installing system-wide, using pip command. You can see in the end, that python is recommending to install such packages using a virtual environment to avoid breakages](https://itsfoss.com/content/images/2023/05/pip-package-install.svg)

Installing packages (Note the warning in the end)

PIP doesn’t support tab completion by default. So you need to know the exact package name that you want to install. How do you get that? I show that to you in the next section.

### Search for packages in PyPI

To search for packages in the Python Package Index, you can go to their official package search website.

[Search PyPI Packages](https://pypi.org/search/?ref=itsfoss.com)

For example, if you search on ‘stress’, it will show all the packages that have the string ‘stress’ in their name or description.

![PyPI website package search results](https://itsfoss.com/content/images/2023/05/pypi-search.png)

PyPI search

Pip had provided a command line search option, which was disabled due to excessive web traffic issues. So, if you try to use `pip search package-name`, you will come across an error, as shown in the screenshot below.

![Searching for PyPI packages using "pip search" command in terminal will result in an error, since that service has been disabled.](https://itsfoss.com/content/images/2023/05/pip-search-error.png)

`pip search` error

So, use the PyPI website instead, as mentioned above.

### Upgrade Packages installed via pip

To [upgrade packages installed via pip](https://itsfoss.com/upgrade-pip-packages/), use the command below:

```
pip3 install --upgrade <package-name>
```

### Remove packages installed via pip

If you want to remove a Python package installed via pip, you can use the remove option.

```
pip3 uninstall <installed_package_name>
```

## Uninstall Pip from Ubuntu

To remove pip from Ubuntu, open a terminal and run:

```
sudo apt remove python3-pip
sudo apt autoremove
```

## Pipx is better! Start using it instead of Pip

Actually, if you want to use Pip for installing Python-based GUI applications, you should use Pipx. It complies with the new Python guidelines.

[Using Pipx](https://itsfoss.com/install-pipx-ubuntu/) is similar to Pip so it should feel familiar.

[Install and Use pipx in Ubuntu & Other LinuxPipx addresses the shortcomings of the popular pip tool. Learn to install and use Pipx in Linux.![](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)It's FOSSSagar Sharma![](https://itsfoss.com/content/images/2023/05/install-pipx-ubuntu.png)](https://itsfoss.com/install-pipx-ubuntu/)

I hope you like this tutorial on installing and using Pip on Ubuntu and hopefully on other distributions, too. Let me know if you have questions or suggestions.