Installation#
If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip’s maintainers:
ensurepip #
Python comes with an ensurepip module [ 1 ] , which can install pip in a Python environment.
More details about how ensurepip works and how it can be used, is available in the standard library documentation.
get-pip.py #
This is a Python script that uses some bootstrapping logic to install pip.
Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:
More details about this script can be found in pypa/get-pip’s README.
Standalone zip application#
The zip application is currently experimental. We test that pip runs correctly in this form, but it is possible that there could be issues in some situations. We will accept bug reports in such cases, but for now the zip application should not be used in production environments.
In addition to installing pip in your environment, pip is available as a standalone zip application. This can be downloaded from https://bootstrap.pypa.io/pip/pip.pyz. There are also zip applications for specific pip versions, named pip-X.Y.Z.pyz .
The zip application can be run using any supported version of Python:
If run directly:
then the currently active Python interpreter will be used.
Alternative Methods#
Depending on how you installed Python, there might be other mechanisms available to you for installing pip such as using Linux package managers .
These mechanisms are provided by redistributors of pip, who may have modified pip to change its behaviour. This has been a frequent source of user confusion, since it causes a mismatch between documented behaviour in this documentation and how pip works after those modifications.
If you face issues when using Python and pip installed using these mechanisms, it is recommended to request for support from the relevant provider (eg: Linux distro community, cloud provider support channels, etc).
Upgrading pip #
Upgrade your pip by running:
Compatibility#
The current version of pip works on:
Windows, Linux and MacOS.
CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
pip is tested to work on the latest patch version of the Python interpreter, for each of the minor versions listed above. Previous patch versions are supported on a best effort approach.
Other operating systems and Python versions are not supported by pip’s maintainers.
Users who are on unsupported platforms should be aware that if they hit issues, they may have to resolve them for themselves. If they received pip from a source which provides support for their platform, they should request pip support from that source.
The ensurepip module was added to the Python standard library in Python 3.4.
Installing pip/setuptools/wheel with Linux Package Managers¶
This section covers how to install pip , setuptools , and wheel using Linux package managers.
If you’re using a Python that was downloaded from python.org, then this section does not apply. See the Requirements for Installing Packages section instead.
Note that it’s common for the versions of pip , setuptools , and wheel supported by a specific Linux Distribution to be outdated by the time it’s released to the public, and updates generally only occur for security reasons, not for feature updates. For certain Distributions, there are additional repositories that can be enabled to provide newer versions. The repositories we know about are explained below.
Also note that it’s somewhat common for Distributions to apply patches for the sake of security and normalization to their own standards. In some cases, this can lead to bugs or unexpected behaviors that vary from the original unpatched versions. When this is known, we will make note of it below.
Fedora¶
To learn more about Python in Fedora, please visit the official Fedora docs, Python Classroom or Fedora Loves Python.
CentOS/RHEL¶
CentOS and RHEL don’t offer pip or wheel in their core repositories, although setuptools is installed by default.
To install pip and wheel for the system Python, there are two options:
Enable the EPEL repository using these instructions. On EPEL 7, you can install pip and wheel like so:
Since EPEL only offers extra, non-conflicting packages, EPEL does not offer setuptools, since it’s in the core repository.
Enable the PyPA Copr Repo using these instructions 1. You can install pip and wheel like so:
To additionally upgrade setuptools, run:
To install pip, wheel, and setuptools, in a parallel, non-system environment (using yum) then there are two options:
Use the “Software Collections” feature to enable a parallel collection that includes pip, setuptools, and wheel.
Be aware that collections may not contain the most recent versions.
Enable the IUS repository and install one of the parallel-installable Pythons, along with pip, setuptools, and wheel, which are kept fairly up to date.
Установка PIP в Ubuntu
Существует несколько способов установки программного обеспечения в Ubuntu. Можно использовать центр приложений, установить deb-пакет, подключить репозиторий PPA, использовать Snap-пакеты, Flatpack или AppImage или даже собрать программу из исходного кода.
Однако существует еще один способ установки программ в Linux — это утилита PIP. Это система управления пакетами, которая используется для установки и управления программными пакетами, написанными на Python. В этой статье будет рассмотрена установка PIP в Ubuntu 20.04. Также будет показано, как пользоваться данной программой.
Что такое PIP?
Уже по сложившейся традиции, для программного обеспечения Linux название PIP является рекурсивным акронимом. Оно означает Pip Installs Packages. Это система управления пакетами, работающая через командную строку. Она используется для установки и управления программным обеспечением, написанным на языке программирования Python. Можно устанавливать все пакеты, которые присутствуют на pypl.org — каталоге программного обеспечения для языка Python.
Если вы разработчик, то PIP можно использовать для установки различных библиотек и модулей Python, которые потом можно подключать к своим проектам. Если вы обычный пользователь, то данная утилита открывает возможности для легкой установки некоторых программ. Один из таких примеров — приложение Stress Terminal, которое можно установить через PIP.
Установка PIP в Ubuntu 20.04
Утилита PIP не поставляется в Ubuntu по умолчанию. Если она необходима, её придётся установить. Это очень просто, но есть один момент, о котором надо знать. Так как существует 2 версии языка Python – Python 2 и Python 3, то данная утилита называется для каждой версии языка по-своему. Для Python 2 это PIP, а для Python 3 это PIP3
В Ubuntu 20.04 по умолчанию установлен Python только 3 версии. Соответственно пакет для установки будет называться PIP3. Обратите внимание, что для написания этой статьи использовался алгоритм установки для Ubuntu 20.04, но нижеприведённые команды подойдут и для более ранних версий дистрибутива, а также для дистрибутивов, основанных на Ubuntu (например Debian).
Сначала необходимо убедиться, что Python 3 установлен в системе выполнив команду в терминале:

Команда выведет текущую версию Python, которая используется в системе. Далее необходимо установить pip3:
sudo apt -y install python3-pip

После установки pip3 необходимо убедиться, что утилита установилась в систему без ошибок при помощи команды:

Команда выведет версию pip и полный путь куда была установлена утилита. Установка pip в Ubuntu 20.04 завершена, теперь необходимо разобраться как ей пользоваться.
Как пользоваться PIP
Для начала необходимо разобраться в синтаксисе утилиты и изучить её основные команды. Они помогут вам искать, устанавливать и удалять пакеты. Синтаксис утилиты довольно прост:
$ pip3 команда опции имя_пакета
Вот основные команды, которые можно использовать:
- install — установить пакет;
- uninstall — удалить пакет;
- search — найти пакет;
- list — список установленных пакетов;
- show — просмотр информации про установленный пакет.
У pip достаточно много разных опций и команд, поэтому здесь все они описаны не будут. Для просмотра всех команд и опций к ним можно вызвать справку при помощи команды

Для поиска необходимых пакетов перейдите на официальный сайт pypi:

В поле поиска введите имя необходимого пакета. Далее нажмите на клавишу Enter или на значок лупы, который находиться справа от строки поиска:

В результате поиска будут отображены все пакеты, в именах которых содержится слово, которое было введено в поисковую строку. Перейдите на страницу необходимого пакета и отобразится подробное описание о данном пакете – информация о пакете, пример использования, история изменений и т.д.

На странице каждого пакета присутствует команда для установки. Она располагается под названием пакета. Скопируйте команду установки и вставьте в окно терминала. После этого пакет будет установлен в систему. Например:
sudo pip3 install s-tui

Стоит обратить внимание что установка программ при помощи pip производится от имени суперпользователя (в данном случае при помощи sudo). После установки программу можно запустить, введя в терминале команду:

Теперь программа отобразится в списке установленных пакетов:


Чтобы удалить программу, необходимо использовать команду uninstall:
sudo pip3 uninstall s-tui

Удаление пакетов при помощи pip так же, как и установка производиться от имени суперпользователя. При появлении сообщения Proceed (y/n/)? введите y нажмите на клавишу Enter. После этого программа будет полностью удалена из системы. Для версии pip предназначенной для Python 2 все команды аналогичны.
Выводы
В данной статье была рассмотрена установка и использование утилиты pip для установки пакетов для языка программирования Python версии 3. Если у вас остались вопросы, спрашивайте в комментариях!
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
How to Install Python Pip on Ubuntu 18.04 and 20.04

Whether you’re a VPS web server administrator, a software developer, or a general user, you might need to install pip on Ubuntu. As a package management system, pip lets you install packages of software written in the Python programming language.
In this tutorial, we will explain what pip is, how it works, and the ways to install pip on Ubuntu using Python 2 and Python 3. Finally, we’ll also go over how to install a pip package.

How to Install Pip on Ubuntu
This section will explain how to install Pip on Ubuntu using Python 2 and Python 3. We will also go over basic pip commands, including how to install a pip package.
How to Install Pip for Python 2
First, let’s go over how to install pip on the Ubuntu operating system for a machine that runs Python 2. However, pip for Python 2 uses different commands depending on which Ubuntu version you’re running.
In the following sections, you will find step-by-step instructions on how to install pip for Python on Ubuntu 18.04 and Ubuntu 20.04.
How to Install Pip on Ubuntu 18.04
On Ubuntu 18.04, Python 2 and pip are not installed by default. Follow these steps to install them:
- Open the terminal. To quickly do it, press Ctrl+Alt+T.
- Make sure that your Ubuntu 18.04 system is running Python 2 by entering the following command to the terminal:
- Update the repository package list by inputting this command:
- Begin installing Python 2 and pip by running the following command:
- Verify whether pip has been installed correctly by running this command:
- You have the option to install a file – requirements.txt – which contains a list of all the packages that can be installed using pip. To install the requirements, enter the following pip command:
- Finally, make sure that you have the latest version of pip for Python. The latest iteration of pip that supports Python 2 is the 20.3.4 version. To upgrade pip to the latest version, run the following pip command:
The installed version may differ depending on the version of pip you’ve installed on your Ubuntu system.
How to Install Pip on Ubuntu 20.04
pip for Python 2 is not included with Ubuntu 20.04. To install pip for Python 2 on Ubuntu 20.04, you will have to use the get-pip script.
- Open the terminal window. For a shortcut, press Ctrl+Alt+T.
- To update the repository package list, run the following command:
- If you haven’t installed Python 2, do so first by entering the following command:
- Download the get-pip.py script using curl:
- Once the script is downloaded, run it as a Python 2 sudo user:
- Make sure that pip has been installed successfully by printing its version number with this command:
Note that if you want to install pip on your user account only, run the script without sudo.
Depending on which version of pip you have installed on the Ubuntu system, the output will be similar to the following:
How to Install Pip3 in Ubuntu
Pip for Python 3 is commonly referred to as pip3. Fortunately, Ubuntu 18.04 has Python 3 installed by default. However, you will still need to install pip3 manually. Follow these steps:
- Open the terminal.
- To update the repository package list, run the following command:
- Install pip for Python 3 and all the dependencies by entering this command:
- Verify the installation by printing your version number of pip:
- To upgrade pip to the newest version, run the following command:
How to Install a Pip Package
Now that you have installed pip on your Ubuntu machine, you can start installing Python packages found in the Python Package Index (PyPI) with pip and manage them using various commands.
Keep in mind that the commands you need to use will depend on the version of Python installed. The following commands are applicable for Python 3. If you use Python 2, simply change pip3 to pip in each command.
To install a package, run:
For example, here’s how to install Scrapy – the web-crawling framework tool – on a machine running Python 3:
To install a specific version of a package with pip, specify the version number in the command. For example, run this command if you want to install Scrapy 1.5:
To update an installed package to the newest version that’s available on the Python Package Index (PyPI), enter this command:
For example, enter this command to update Scrapy on a machine that’s running Python 3:

Sometimes, you will want to remove installed pip packages. To uninstall a package on Python 3, run the following command:
What Is Pip and What Does It Do?
Pip, which stands for “pip installs packages”, is a command-line package management system for software written in the Python programming language. Once installed, pip allows you to install and manage Python packages from the command line or a terminal program.
A Python package is a collection of Python modules. They contain Python definitions and statements, usually including runnable code.
Pip eases the process of installing and managing Python modules and packages because it connects to the Python Package Index (PyPI) – the official third-party software repository for Python.
When a user installs Python packages using pip, the package manager will resolve all the dependencies and check whether the chosen software packages are already installed. If pip finds that the software hasn’t been installed, it will install them on the machine.
Conclusion
Pip is a helpful command line package manager and installer for Ubuntu. Using various commands, pip allows you to manage Python software packages from the Ubuntu terminal.
In this tutorial, you have learned how to install pip on Ubuntu machines running both Python 2 and Python 3. We’ve also gone over how to use pip to install a Python package and upgrade it to the latest version.
We hope you’ve found this article helpful and wish you the best of luck in your future projects with pip on Ubuntu.
Learn What Else Your Ubuntu Can Do

Hasna is passionate about tech, culture, and the written word. She hopes to create content that helps people succeed on the web. When not writing, rearranging, or polishing sentences, she enjoys live music and overanalyzing movies.