Установить pip python debian

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.

$ python -m ensurepip --upgrade
$ python -m ensurepip --upgrade

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.

  • Download the script, from https://bootstrap.pypa.io/get-pip.py.
  • 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:

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:

$ python -m pip install --upgrade pip
$ python -m pip install --upgrade pip
C:> py -m pip install --upgrade pip

Compatibility#

The current version of pip works on:

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.

Источник

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.

$ python -m ensurepip --upgrade
$ python -m ensurepip --upgrade

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.

  • Download the script, from https://bootstrap.pypa.io/get-pip.py.
  • 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:

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:

$ python -m pip install --upgrade pip
$ python -m pip install --upgrade pip
C:> py -m pip install --upgrade pip

Compatibility#

The current version of pip works on:

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.

Источник

Install PIP on Debian 11

This tutorial explains how to install PIP for Python 3 and Python 2 on Debian 11 and other Debian-based Linux distributions, such as Ubuntu.

PIP (Pip Installs Packages) is a Python written packages manager used to install software from repositories. If you don’t know PIP, you can think of it as a similar tool to the Debian apt command. Basically, the syntax to install packages using the PIP packages manager is pip install .

This tutorial covers PIP installation, both for Python 3 and Python 2, despite Python 2 isn’t supported on default by Debian repositories. This article also explains how to get both PIP versions with just a command. Additionally, I added instructions to keep PIP up-to-date and to use it to install the software.

Installing PIP3 on Debian 11

To begin, update your package repositories by running the apt command, followed by the update option as shown below:

You can install Python (3) also using the apt command followed by the install option as shown below:

To check your Python 3 version, you can run the command below:

Then, install PIP3 by running the following command:

To check your PIP version, run the following command:

As you can see, PIP for Python 3 is installed.

Installing PIP2 on Debian 11

As discussed, while Python 2 is still available for Debian 11, it doesn’t support PIP2 in the packages manager. However, you can get it installed by following the steps explained below:

Use the apt command to install the python2 package as shown below:

Once Python 2 is installed, download and execute the pip installer for Python 2 by running the following command:

You can check your Python 2 version by executing the command below:

To check both Python 2 and pip versions run the following command:

As you can see, PIP for Python 2 is installed.

Keep PIP Updated

You can use the command shown in the following screenshot to keep PIP up-to-date:

Now, PIP and its components are up to date.

Using PIP to Install Software

As mentioned previously, PIP is a packages manager used to install the Python written software. The syntax to install packages is pretty simple. Just execute PIP followed by the install option and the package’s name. The syntax to install a package is the same as with the apt command.

As you can see, the package was properly installed.

You can find available projects to download at https://pypi.org.

To upgrade packages using PIP, run the following command:

In this case, the software was already up-to-date.

Uninstalling Packages Using PIP

To remove packages using PIP, use the following syntax. When asked for confirmation, press Y.

To remove the translator package, run the following command. When asked for confirmation, press Y.

And as you can see in the screenshot below, the package was properly removed:

Conclusion

Thank you for reading this tutorial explaining how to install PIP on Debian 11 Bullseye. As you can see, installing both PIP for Python 3 and Python 2 is pretty easy. Any Linux-level user can get it done by following a few steps explained in this article.

Despite this tutorial showing PIP for Python 2 installation, it isn’t recommended. Instead, use Python 3. Also, remember to keep PIP and its components up-to-date using the commands explained for that purpose.

Thank you again for learning from Linux Hint. Keep following us for additional tips and tutorials.

About the author

David Adams

David Adams is a System Admin and writer that is focused on open source technologies, security software, and computer systems.

Источник

Как установить Pip на Debian 10

Pip — это система управления пакетами, которая позволяет устанавливать пакеты Python. С помощью pip вы можете устанавливать пакеты из индекса пакетов Python (PyPI) и других репозиториев.

В этом руководстве мы объясним, как установить pip для Python 2 pip и Python 3 pip3 в Debian 10, Buster, используя диспетчер пакетов apt . Мы также покажем вам, как устанавливать пакеты Python и управлять ими с помощью pip.

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

Выполните следующие шаги как пользователь с привилегиями sudo для установки Pip для Python 3 в Debian 10:

    Начните с обновления списка пакетов:

sudo apt install python3-pip
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

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

Следующие шаги описывают, как установить Pip для Python 2 в системах Debian:

    Начните с обновления индекса пакетов:

sudo apt install python-pip
pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7)

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

В этом разделе мы поговорим об основных командах pip. С помощью pip вы можете устанавливать пакеты из PyPI, контроля версий, локальных проектов и из файлов распространения, но в большинстве случаев вы будете устанавливать пакеты из PyPI.

Если вы хотите установить модуль python глобально, вам лучше установить его как пакет с помощью диспетчера apt . Используйте pip для глобальной установки модулей Python, только если пакет недоступен.

Обычно вы используете pip только внутри виртуальной среды. Virtual Environment Python позволяет устанавливать модули Python в изолированном месте для конкретного проекта, а не глобально. Таким образом, вам не нужно беспокоиться о влиянии на другие проекты Python.

Допустим, вы хотите установить пакет с именем urllib3 , вы можете сделать это, выполнив следующую команду:

pip uninstall package_name

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

Выводы

Мы показали вам, как установить pip в вашу систему Debian и как управлять пакетами Python с помощью pip. Дополнительные сведения о pip см. В руководстве пользователя pip .

Если у вас есть какие-либо вопросы или отзывы, не стесняйтесь оставлять комментарии ниже.

Источник

Читайте также:  Mysql insert or die php
Оцените статью