本文介绍了在 2020 年 1 月 1 日生命周期结束后,PIP 是否适用于 python 2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python 2.7 将于 2020 年 1 月 1 日结束,如

Python 2.7 is reaching its end of life on 1st Jan, 2020 as mentioned by

https://legacy.python.org/dev/peps/pep-0373/

https://pythonclock.org/

当前的 pip 会在那个日期之后继续为 python 2.7 工作吗?它已经显示了弃用 python 2.7 的 msg.我们能跑吗pip install abc==1.2.3 在那个日期之后?

Will current pip keep on working for python 2.7 after that date? It is already showing the msg for deprecation of python 2.7. Will we be able to runpip install abc==1.2.3 after that date?

我们确实理解在 EOL 之后,不会对 2.7 进行新的修复/支持,因此这不是这里的问题.

We do understand that after EOL, no new fixes/support will be done for 2.7, so that is not the concern here.

这个问题源于希望在 EOL 之后继续在 python 2.7 上运行.

The question stems from the desire to keep running on python 2.7 even after EOL.

推荐答案

您需要确保您拥有适用于 Python 2.7 的正确版本的 pip:

You need to make sure you have the right version of pip for Python 2.7:

pip install --upgrade "pip < 21.0"

该版本将运行一段时间.它们迟早会失败,因为 PyPI 主机将 SSL 配置更改为 Python 2.7 无法处理的配置.但我相信我们还有几年时间在那之前.

That versions will be working for some time. Sooner or later they fail because PyPI host changes SSL configuration to one that Python 2.7 doesn't handle. But I'm sure we have a few years before that.

重要工具的一些额外版本限制,以保持与 Python 2.7 的兼容性:

A few additional version limits for important tools to retain compatibility with Python 2.7:

pip install --upgrade "setuptools < 45" "Sphinx < 2.0" "pytest < 5.0"

如果您使用其他工具,请彻底遵循他们的公告,以发现他们停止支持 2.7.

If you use other tools follow their announcements thoroughly to catch them stopping supporting 2.7.

这篇关于在 2020 年 1 月 1 日生命周期结束后,PIP 是否适用于 python 2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 23:36