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.
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.
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
解决方案
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.
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.
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: