Python pip linux 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.

Источник

DESCRIPTION¶

pip is a Python package installer, recommended for installing Python packages which are not available in the Debian archive. It can work with version control repositories (currently only Git, Mercurial, and Bazaar repositories), logs output extensively, and prevents partial installs by downloading all requirements before starting installation.

On Debian, pip is the command to use when installing packages for Python 2, while pip3 is the command to use when installing packages for Python 3.

COMMANDS¶

The command comes before any options. The following commands are recognized:

help Show help for commands. install Install packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. search Search PyPI for packages. wheel Build wheels from your requirements.

GENERAL OPTIONS¶

This list is by no means complete, and it only describes options available to all commands. Use pip —help for more details on command specific options. A few command options are provided below.

INSTALL OPTIONS¶

pip install installs packages from:

  • PyPI (a.k.a. The Cheeseshop) and other indexes, using requirements specifiers.
  • VCS project urls.
  • Local project directories.
  • Local or remote source archives
  • Local wheel directories (python-pip-whl installs its wheels in /usr/share/ python-wheels and they can be locally installed by pip using —find-links)

-e, —editable Install a project in editable mode (i.e. setuptools «develop mode») from a local project path or a VCS url. -r, —requirement Install from the given requirements file. This option can be used multiple times. -b, —build Directory to unpack packages into and build in. The default in a virtualenv is «/build». The default for global installs is «/pip_build_». -t, —target Install packages into . -d, —download Download packages into instead of installing them, regardless of what’s already installed. —download-cache Cache downloaded packages in . —src Directory to check out editable projects into. The default in a virtualenv is «/src». The default for global installs is «/src». -U, —upgrade Upgrade all packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied. —force-reinstall When upgrading, reinstall all packages even if they are already up-to-date. -I, —ignore-installed Ignore the installed packages (reinstalling instead). —no-deps Don’t install package dependencies. —install-option Extra arguments to be supplied to the setup.py install command (use like —install-option =»—install-scripts=/usr/local/bin»). Use multiple —install-option options to pass multiple options to setup.py install. If you are using an option with a directory path, be sure to use absolute path. —global-option Extra global options to be supplied to the setup.py call before the install command. —user Install using the user scheme. —egg Install packages as eggs, not ‘flat’, like pip normally does. This option is not about installing from eggs. (WARNING: Because this option overrides pip’s normal install logic, requirements files may not behave as expected.) —root Install everything relative to this alternate root directory. —compile Compile py files to pyc. —no-compile Do not compile py files to pyc. —no-use-wheel Do not find and prefer wheel archives when searching indexes and find-links locations. —pre Include pre-release and development versions. By default, pip only finds stable versions. —no-clean Don’t clean up build directories.

UNINSTALL OPTIONS¶

pip is able to uninstall most installed packages. Known exceptions are:

  • Pure distutils packages installed with python setup.py install, which leave behind no metadata to determine what files were installed.
  • Script wrappers installed by python setup.py develop.

AUTHORS¶

This manual page was originally written by Jeff Licquia licquia@debian.org>, later rewritten by Carl Chenet chaica@debian.org>. It was rewritten again and the source converted to reStructuredText by Barry Warsaw barry@debian.org>.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, version 3 or any later version published by the Free Software Foundation.

AUTHOR¶

Source file: pip.1.en.gz (from python3-pip 20.3.4-4+deb11u1)
Source last updated: 2022-03-07T15:19:24Z
Converted to HTML: 2023-05-05T03:37:58Z

Источник

Как установить 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 .

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

Источник

Читайте также:  Как запустить калькулятор linux
Оцените статью
Adblock
detector