How to install pip on linux

How to install pip on linux

How To Install PIP to Manage Python Packages in Linux

Pip (recursive acronym for “Pip Installs Packages” or “Pip Installs Python“) is a cross-platform package manager for installing and managing Python packages (which can be found in the Python Package Index (PyPI)) that comes with Python 2 >=2.7.9 or Python 3 >=3.4 binaries that are downloaded from python.org.

In this article, we will explain how to install PIP on mainstream Linux distributions.

Note: We will run all commands as the root user, if you are managing your system as a normal user, then use the sudo command to get root privileges or you can as well configure your system to run sudo command without entering a password, it’s possible. Try it out!

Install PIP in Linux Systems

To install pip in Linux, run the appropriate command for your distribution as follows:

Install PIP On Debian/Ubuntu

Install PIP On CentOS and RHEL

Unluckily, pip is not packaged in official software repositories of CentOS/RHEL. So you need to enable the EPEL repository and then install it like this.

Install PIP on Fedora

Install PIP on Arch Linux

Install PIP on openSUSE

How to Use PIP in Linux Systems

To install, uninstall or search new packages, use these commands.

To see a list of all commands type:

Sample Output

You may also like to read these following related articles about Python.

In this article, we showed you how to install PIP on mainstream Linux distributions. To ask any questions relating to this topic, please take advantage of the feedback form below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

We are thankful for your never ending support.

Установка PIP в Ubuntu

Существует несколько способов установки программного обеспечения в Ubuntu. Можно использовать центр приложений, установить deb-пакет, подключить репозиторий PPA, использовать Snap-пакеты, Flatpack или AppImage или даже собрать программу из исходного кода.

Что такое 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 установлен в системе выполнив команду в терминале:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Команда выведет версию pip и полный путь куда была установлена утилита. Установка pip в Ubuntu 20.04 завершена, теперь необходимо разобраться как ей пользоваться.

Как пользоваться PIP

Для начала необходимо разобраться в синтаксисе утилиты и изучить её основные команды. Они помогут вам искать, устанавливать и удалять пакеты. Синтаксис утилиты довольно прост:

$ pip3 команда опции имя_пакета

Вот основные команды, которые можно использовать:

У pip достаточно много разных опций и команд, поэтому здесь все они описаны не будут. Для просмотра всех команд и опций к ним можно вызвать справку при помощи команды

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

sudo pip3 install s-tui

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

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

sudo pip3 uninstall s-tui

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Удаление пакетов при помощи pip так же, как и установка производиться от имени суперпользователя. При появлении сообщения Proceed (y/n/)? введите y нажмите на клавишу Enter. После этого программа будет полностью удалена из системы. Для версии pip предназначенной для Python 2 все команды аналогичны.

Выводы

В данной статье была рассмотрена установка и использование утилиты pip для установки пакетов для языка программирования Python версии 3. Если у вас остались вопросы, спрашивайте в комментариях!

How to Install PIP on Windows/Linux? [A Complete Guide]

Are you looking for the Python PIP Installation guide? Then this blog post about how to install pip on windows will help you to make it happen?

List of content you will read in this article:

When you are dealing with Python, there is a requirement of tons of packages, you can use the available ones with the help of the default package manager, however, PIP might be required to install some. PIP or Package Installer for Python. You can install the software packages or libraries that are not included in the Python Standard Library.

Moreover, if you seek to install some additional dependencies or packages, you can simply install PIP on Windows and Linux operating systems. PIP uses Python Package Index for all the packages. You must be familiar with the term, package manager if you know the programming world. This tutorial will guide you, how to install PIP on Windows and Linux?

Let us now head towards the process of installing PIP in Windows first!

How to install PIP on Windows? [A Step by Step Guide]

Let’s move to understand the complete step/procedure.

Python 3.7.0 (v3.7.0:1bf9cc5093, Jan 25 2019, 07:44:31) [MSC v.1914 64 bit (AMD64)] on win32

Type «help», «copyright», «credits» or «license» for more information.

Let us now quickly move to understand how to install PIP on Windows process.

Follow these steps to achieve your task:

Step 1: You need to download PIP get-pip.py

You have to download get-pip.py before installing PIP. Now, remember the location where you save the file as this path is required in the process later.

Step 2: Open the Windows Command Line

The next step is to open the Command prompt window. Simply follow these steps:

If not these steps, then you can simply type cmd in the search bar and the command prompt will be displayed on your screen.

Additionally, there are instances where you have to run/access the prompt window as an administrator. Now, when can you encounter these situations? Sometimes, while you perform a task, you may encounter a message saying that you do not have access to some specific permissions in order to run an application or a program. In such situations, you are required to run the app as an admin.

In order to conclude that, click right on the Command Prompt and choose ‘Run as’, then select As Administrator. And you’re done!

Step 3: Install PIP on Windows

Now, open the Command Prompt, and type the cd command, and then the path where you saved the get-pip.py file. Remember?

Cross-check the file’s path as this can later cause a problem in the installation process.

Now, follow this command:

After this, the installation process begins.

Moving on, in order to display the list of your current directory, type:

Step 4: Check PIP version

If you wish to see the version of your PIP, go to the Command Prompt and type the following command:

The current version displays on the screen.

Step 5: Installation verification

As you had earlier initiated the process of installation, now you can check whether the process is successful or not.

If your installation is successful, you will encounter this message.

pip 18.0 from c:\users\administrator\appdata\local\programs\python\lib\site-packages\pip (python 3.7)

If not, kindly repeat your installation.

Step 6: How to configure?

The PIP configuration file in Windows is %HOME%\pip\pip.ini located at %APPDATA%\pip\pip.ini. Now, if you want to set the location as per your wish, use PIP_Config_File.

Moreover, if you further wish to upgrade your PIP version, you can do that. It discards the older version and installs the latest one. To accomplish this task, type the following command:

Moving onto the last segment, what if you want to downgrade the installed PIP version in your system? Well, you may think, why is this necessary?

Well, there are times when you install a new version and it does not work seamlessly. To sort that issue, you need to downgrade the version to revert to the previously installed version. Use this command:

That’s it! Yes, it is this simple process through which you will be able how to install PIP on Windows. Let us head towards our next segment.

How to install PIP on Linux? [A Step by Step Guide]

Now, Python Package Index is used by PIP as the default source for the packages. Hence, when you type,

pip install package_name

This command scans for the mentioned package in PyPI. As soon as it finds the package, it downloads and installs it. Now, it depends on which version either Python pip or Python3-pip, you’re working with.

Here is a step-by-step guide to the whole process screenshot.

Step 1: Start by typing the following command:

Sudo apt-get install python3-pip python-dev

Step 2: Next up, you will see this window.

Here, the installer is simply providing the disk space.

Step 3: Next, it downloads the libraries as shown below.

Step 4: Now, all the files and packages start unpacking.

Step 5: Lastly, the few more steps of the installation look like this.

General syntax:

As we have taken the example of the Numpy library, just write NumPy in the place of the package name. Here is how:

# pip3 install numpy

Step 6: Moving on, let’s say you want to search for the availability of some packages, use this command:

# pip3 search numpy

Step 7: Next, to know all the Python packages installed in the system, follow this command:

To gain any additional information about the installed packages, use the following:

# pip3 show numpy

Step 8: Now, finally, if you wish to uninstall the packages, use this simple command:

# pip3 uninstall numpy

Conclusion

We hope that with the help of this article, you have successfully learned how to install PIP on Windows and Linux operating systems. You can now easily manage your packages with the help of Python PIP. If you faced any issues during the installation process or have any questions, please leave them via the listed comment box below.

Установка и использование PIP в Linux

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Что такое PIP

Pip (сокращение от Python Installs Packages) — это пакетный менеджер для языка программирования Python.

Мы привыкли к пакетным менеджерам в дистрибутивах Linux. Через них мы устанавливаем и удаляем приложения, библиотеки, драйвера и другие компоненты системы.

Для некоторых языков программирования, также были созданы пакетные менеджеры, которые предназначены для установки пакетов, необходимых конкретному языку. Например, для языка Ruby есть gem, а для Node.js есть npm. Pip — это пакетный менеджер для языка Python.

Pip позволяет устанавливать и управлять программными пакетами, написанными на Python. Работа с PIP выполняется через командную строку.

Pip позволяет устанавливать любые пакеты из репозитория Python Package Index (PyPl). Можно использовать и другие репозитории, но обычно все необходимое доступно в PyPl.

Какую версию PIP устанавливать

В настоящее время Python 3 является самой свежей версией языка Python.

Многие дистрибутивы Linux устанавливаются только с поддержкой Python 3. Python 2 уже почти не используется и для его поддержки нужно устанавливать дополнительные пакеты в систему.

Поэтому, если вы не знаете, какую версию PIP устанавливать, то, скорее всего, вам и большинству пользователей нужно устанавливать PIP именно для Python 3.

Если требуется PIP для Python 2, то его можно установить совместно с 3-й версией.

Установка PIP

Рассмотрим, как установить PIP в различных дистрибутивах Linux.

Установка PIP в Ubuntu Linux (Linux Mint)

Для установки PIP в Ubuntu Linux и других производных от него дистрибутивах можно использовать штатные репозитории Ubuntu.

Установка PIP для Python 3 в Ubuntu

Для установки PIP для Python 3 выполните в терминале команду:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Команда для использования PIP 3 в Ubuntu: pip3

После установки можно проверить версию PIP. Для этого выполните команду:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Установка PIP для Python 2 в Ubuntu

Для установки PIP для Python 2 необходимо установить пакет python-pip. Во время установки будет установлен Python 2 (если он уже не установлен), так как он входит в зависимости этого пакета. Выполните команду:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Команда для использования PIP 2 в Ubuntu: pip

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Установка PIP в Fedora Linux

Для установки PIP 3 в Fedora Linux выполните команду:

Для установки PIP 2 в Fedora Linux:

Установка PIP в Arch Linux

Для установки PIP 3 в Arch Linux выполните команду:

Для установки PIP 2 в Arch Linux:

Установка PIP в openSUSE

Для установки PIP 3 в openSUSE выполните команду:

Для установки PIP 2 в openSUSE:

Использование PIP

Синтаксис команды pip3 (в зависимости от дистрибутива и версии название команды может отличаться):

Пример использования: pip install numpy

команда — это действие, которое необходимо выполнить. Список часто используемых команд:
install — установить пакет.
download — скачать пакет и зависимости (без установки).
uninstall — удалить пакет.
list — вывести список установленных пакетов.
show — показать информацию о пакете.
search — поиск пакета (в репозитории PyPI).

Примеры использования PIP

Рассмотрим примеры использования PIP для управления пакетами.

Установка пакета

Для установки свежей версии пакета необходимо выполнить команду install:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Установка определенной версии пакета

Установка определенной версии — указывается имя пакета, два знака равенства и требуемая версия пакета:

Установка пакета не ниже определенной версии:

Обновление пакета

Обновить уже установленный пакет до самой свежей версии:

Список установленных пакетов

How to Install Pip on Ubuntu 18.04

Updated Feb 20, 2019

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Pip is a package management system that simplifies installation and management of software packages written in Python such as those found in the Python Package Index (PyPI). Pip is not installed by default on Ubuntu 18.04, but the installation is pretty straightforward.

In this tutorial, we will show you how to install Python Pip on Ubuntu 18.04 using the apt package manager. We will also walk you through the basics of installing and managing Python packages with pip.

Prerequisites #

Installing pip for Python 3 #

Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip ( pip3 ) for Python 3:

Start by updating the package list using the following command:

Use the following command to install pip for Python 3:

The command above will also install all the dependencies required for building Python modules.

Once the installation is complete, verify the installation by checking the pip version:

The version number may vary, but it will look something like this:

Installing pip for Python 2 #

Python 2 is not installed by default in Ubuntu 18.04. To install Python 2 and pip for Python 2, complete the following steps:

Update the package index by running the following command:

Install pip for Python 2 with:

The command above will install Python2, Pip and all the dependencies required for building Python modules.

Verify the installation by printing the pip version number:

The version number may vary, but it will look something like this:

How to Use Pip #

When installing python modules globally it is highly recommended to install distribution provided python modules using the apt package manager because they are tested to work properly on Ubuntu systems.

You should install Python modules globally using pip only if there is no package available through the package manager.

In most cases, you should use pip within a virtual environment only. Python Virtual Environments allows you to install Python modules in an isolated location for a specific project, rather than being installed globally. This way you do not have to worry about affecting other Python projects.

In this section, we show you a few useful basic pip commands. With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI.

To view the list of all pip commands and options, type:

How to install pip on linux. Смотреть фото How to install pip on linux. Смотреть картинку How to install pip on linux. Картинка про How to install pip on linux. Фото How to install pip on linux

Installing Packages with Pip #

Let’s say you want to install a package called scrapy which is used for scraping and extracting data from websites.

To install the latest version of the package you need to run the following command:

To install a specific version of the package you would issue the following command:

Installing Packages with Pip using the Requirements Files #

requirement.txt is a text file that contains a list of pip packages with their versions that are required to run a specific Python project.

Use the following command to install a list of requirements specified in a file:

Listing Installed Packages #

To list all the installed pip packages use the command below:

Upgrade a Package With Pip #

To upgrade an installed package to the latest version, run:

Uninstalling Packages With Pip #

To uninstall a package run:

Conclusion #

In this tutorial, you have learned how to install pip on your Ubuntu machine and how to manage Python packages using pip. For more information about pip, visit the pip user guide page.

If you have any questions or feedback, feel free to comment below.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *