Will PIP work for python 2.7 after its End of Life on 1st Jan 2020
Solution 1
You need to make sure you have the right version of pip
for Python 2.7:
pip install --upgrade "pip < 21.0"
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.
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"
If you use other tools follow their announcements thoroughly to catch them stopping supporting 2.7.
Solution 2
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:
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.
Solution 3
Yes, Pip for python2.7 is part of Ubuntu 18, which EOLs in April 2028. Ubuntu is really good about maintaining their distros.
Then, by April 2028, it is likely that a new Python2.7-compatible language will be developed and maintained, which will support pip
or something similar. Some kind of compiler hook will be added to Python3 to change the str
back to byte strings and make the parenthesis on print
optional. Or maybe we'll switch to Cython
or some other implementation of Python2.7. But don't worry about that for a few years (unless you have a lot of free time).
Related videos on Youtube
auny
Updated on July 09, 2022Comments
-
auny almost 2 years
Python 2.7 is reaching its end of life on 1st Jan, 2020 as mentioned by
https://legacy.python.org/dev/peps/pep-0373/
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?We do understand that after EOL, no new fixes/support will be done for 2.7, so that is not the concern here.
The question stems from the desire to keep running on python 2.7 even after EOL.
-
pradyunsg over 4 yearsHmm... I think the issue is that Python < 2.7.9 are just not supported at this point. Are you seeing this on a higher patch version?
-
phd over 4 yearsYes. Many projects has already announced they're stopping supporting Python 2.7 at all now, even before 2020-01-01.
-
pradyunsg over 4 yearsI was referring to SSL issue you pointed at, with the advice of sticking to older versions of pip for -- github.com/pypa/pip/issues/4350.
-
pradyunsg about 3 yearsUpdate: pip 21.0 dropped support for Python 2. We don't expect to be making and changes that'll break older pip versions.
-
personal_cloud almost 3 years"EOL'ed Python" is a fantasy. I'm not sure how the Python Foundation thinks they're going to get Ubuntu to EOL a core system component before the distro EOL.
-
kbro over 2 yearsRedHat Enterprise Linux 7 maintenance support runs until June 30 2024, and extended lifecycle support continues for 2 years beyond that, so having Python support disappear slap bang in the middle of a planned 12-year support cycle is inconvenient.
-
pradyunsg over 2 years@kbro -- you'll likely find curiousefficiency.org/posts/2015/04/… to be a worthwhile read. :)
-
syockit over 2 yearsOnly upstream is EOL. The distros can do whatever they want with their own python packages. Maintenance is now their responsibility.