在2020年Python 2生命终止后,我是否仍然能够通过Pip安装依赖项软件包? [英] Will I still able to install dependency package via Pip after Python 2 End of Life in 2020?

查看:167
本文介绍了在2020年Python 2生命终止后,我是否仍然能够通过Pip安装依赖项软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python 2.7和python pip从requirements.txt文件下载所有依赖包,以运行我的项目.我们知道2020年Python 2的生命周期即将结束,我担心我无法再将pip的依赖软件包安装为pip install -r requirements.txt.

I'm using Python 2.7 and python pip to download all dependency packages from requirements.txt file for running my project. As we know the end of life of Python 2 in 2020, I have concern I could not install my dependency package from pip as pip install -r requirements.txt anymore.

我想到的一种方法是从requirements.txt下载所有依赖项,然后将其安装在本地.有可能吗?

One way I could think of is download all dependencies from requirements.txt and install them locally. Is it possible?

我已经阅读了类似的问题

I have read a similar question Will PIP work for python 2.7 after its End of Life on 1st Jan 2020, but the possibility is still not clear for me whether or not pip still be working or not after 2020 EOL of Python 2.

我该如何确认?如何在2020年python 2生命周期结束时通过pip保持依存关系安装?谢谢

How could I confirm that? How could I do to keep dependencies still be installed via pip in 2020 end of life of python 2? Thanks

推荐答案

正如您所链接的问题所示, pip 维护人员愿意在合理可行的范围内支持Python 2.7.现在,您需要考虑另一面:索引.

As seen in the question you linked, the pip maintainers are willing to support Python 2.7 for as long as reasonably feasible. Now you need to consider the other side: the index.

pip 的默认索引为 PyPI ,并且我无法想象他们会仅仅因为相应的解释器到达了他们的寿命终止而决定删除现有的工件或停止提供它们.我很确定他们已经托管并提供了针对已到达使用寿命的Python解释器的工件.例如,请参见针对lxml版本3.4.4的工件清楚地显示了仍然提供针对python 2.6和3.4的文件,它们都已经达到 EOL .

The default index for pip is PyPI, and I can't imagine that they would decide to delete existing artifacts or stop serving them just because the corresponding interpreter reached their end of life. I am pretty sure they already host and serve artifacts that are aimed at Python interpreters that have already reached their end of life. See for example the artifacts for lxml version 3.4.4 clearly show that it is still serving files aimed at Python 2.6 and 3.4, both of them have alredy reached EOL.

我想到的一种方法是从requirements.txt下载所有依赖项,然后将其安装在本地.有可能吗?

One way I could think of is download all dependencies from requirements.txt and install them locally. Is it possible?

这绝对也是可行的.您甚至可以更进一步,并拥有自己的索引.有关想法,请参见以下链接:

This is definitely feasible as well. You could even go a step further and host your own index. See the following links for ideas:

https://packaging.python.org/guides /hosting-your-own-index/

这篇关于在2020年Python 2生命终止后,我是否仍然能够通过Pip安装依赖项软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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