如何使用 python 2.6.6 或 python 2.7.5 安装旧 PIP 版本? [英] How can I install a legacy PIP version with python 2.6.6 or python 2.7.5?

查看:110
本文介绍了如何使用 python 2.6.6 或 python 2.7.5 安装旧 PIP 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力在 python2.6.6(centOS 6) 或 python 2.7.5(CentOS7) 上运行的 centOS 服务器上安装 python pip 模块.由于某些原因,我无法将 python 版本升级到 3 或更高版本.那么在这种情况下,如何使用我的 python2.6 或 python 2.7 平台安装旧的 PIP 版本行 pip 20?谢谢.

I'm struggling to install the python pip module on my centOS server which is running on python2.6.6(centOS 6) or python 2.7.5(CentOS7). Due to some reasons I'm not able to upgrade the python version to 3 or later. So in the case, how can I install a legacy PIP version line pip 20 with my python2.6 or python 2.7 platform? Thanks.

推荐答案

您可以使用 get-pip.py for 2.7.以下是 centos:7 Docker 容器中的示例:

You can use get-pip.py for 2.7. Here's an example in a centos:7 Docker container:

$ python -V
Python 2.7.5
$ curl -fsSL -O https://bootstrap.pypa.io/pip/2.7/get-pip.py
$ python get-pip.py --no-python-version-warning && rm -f get-pip.py
$ python -m pip --version
pip 20.3.4 from /usr/lib/python2.7/site-packages/pip (python 2.7)

文档:https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py.(尽管不可否认,鉴于 Python 2 已停产,他们并没有特意指出 2.6/2.7 分支的存在.)

Docs: https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py. (Though admittedly, they don't go out of their way to point out the presence of the 2.6/2.7 branches, given that Python 2 is prominently EOL.)

这篇关于如何使用 python 2.6.6 或 python 2.7.5 安装旧 PIP 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆