在 2020 年 1 月 1 日生命周期结束后,PIP 是否适用于 python 2.7

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54915381/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:31:50  来源:igfitidea点击:

Will PIP work for python 2.7 after its End of Life on 1st Jan 2020

pythonpython-3.xpython-2.7pip

提问by auny

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

正如所提到的,Python 2.7 将于 2020 年 1 月 1 日结束生命

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

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

https://pythonclock.org/

https://pythonclock.org/

Will current pipkeep 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 run pip install abc==1.2.3after that date?

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

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

我们知道在 EOL 之后,不会对 2.7 进行新的修复/支持,所以这不是这里的问题。

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

问题源于即使在 EOL 之后仍继续在 python 2.7 上运行的愿望。

采纳答案by phd

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

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

pip install --upgrade "pip < 19.1"

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.

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

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

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

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

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

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

回答by pradyunsg

Yes. Python 2 support will live in a "community maintained" state though. Folks who care about it, will have to step up and fix issues -- pip maintainers will likely not work on resolving Python 2 issues. We've documented the exact expectations at:

是的。不过,Python 2 支持将处于“社区维护”状态。关心它的人将不得不加强并解决问题——pip 维护者可能不会致力于解决 Python 2 问题。我们在以下位置记录了确切的期望:

https://pip.pypa.io/en/stable/development/release-process/#python-2-support

https://pip.pypa.io/en/stable/development/release-process/#python-2-support

Note that pip maintainers are volunteers and I, personally, am not interested in doing free work for corporations / organizations which are stuck on an EOL'ed Python even after having a decade to switch.

请注意,pip 维护者是志愿者,我个人对为公司/组织做免费工作不感兴趣,这些公司/组织即使在切换了十年后仍停留在 EOL 的 Python 上。