Amazon Linux 2 AMI安装pip

Installation
Usually, pip is automatically installed if you are:

working in a virtual environment

using Python downloaded from python.org

using Python that has not been modified by a redistributor to remove ensurepip

Supported Methods
If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip’s maintainers:

ensurepip

get-pip.py

ensurepip
Python comes with an ensurepip module1, which can install pip in a Python environment.

Linux
python -m ensurepip --upgrade

MacOS

Windows
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:

Linux
python get-pip.py

MacOS

Windows
More details about this script can be found in pypa/get-pip’s README.

Standalone zip application
Note

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:

Linux
python pip.pyz --help

MacOS

Windows
If run directly:

Linux
python -m pip.pyz --help

MacOS

Windows
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
Upgrading your pip by running:

Linux
python -m pip install --upgrade pip

MacOS

Windows
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.

https://pip.pypa.io/en/stable/installation/#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值