The final Python 2 release marks the end of an era
For you Python users who have been unwilling (or unable) to upgrade to version 3, there’s yet another reason to get motivated: python.org has released Python 2.7.18, the absolute last official release for Python 2.
While it doesn’t add much in terms of features, it does act as a milestone. This release comes after official support for version 2 ended—January 1st of this year—and serves as the final notice. No further releases will be coming, even if major security issues show up. So if you’ve been waiting on migrating, now might be a good time to put your plan into action.
Python is currently at version 3.8.2, as version 3 has been in active development since 2008. But because the two versions were incompatible, the adoption rate has been notoriously slow. Vicki Boykis reported that 40% of all packages downloaded from PyPI for September of 2019 were for version 2.7. Migrations of the code are no small feat, especially at organizations with massive codebases. Dropbox took three years from start to finish. Instagram spent 10 months.
The final countdown to this end of support was already pushed back five years. That’s an admission of sorts that the biggest issue—the incompatibility between the two versions—is magnified when you consider the libraries that people use. There’s an enormous ecosystem of libraries and tooling built up around the Python language, so any project will need to have access to updated libraries before they can even consider upgrading their main project code.
Depending on your needs, this may not push you to upgrade. If you’re running Python on an open server, there are some security issues that could give you pause. Up to to this point, Python has patched any significant security flaws found in its libraries, including one that affected its `ssl` implementation. That won’t happen for new flaws discovered from here on out.
Users who run local scripts, however, can use whatever they feel comfortable with. PyPy, an alternate implementation of Python, has agreed to support version 2 forever. Users who process large amounts of data mathematically may appreciate its speed gains and stick with the old version. To be fair, Python was never about speed. It’s an interpreted language, so it will usually be slower than the equivalent C program.
Even without official support, Python 2 could potentially receive security updates through a community effort. Alternate implementations like PyPy and Tauthon could follow the openJDK model: they have updated implementations of Java versions 6, 7, and 8, which have all reached their end-of-life points. If new security flaws are discovered in Python 2, these implementations could patch them.
Even outside of these alternate implementations, Python 2 may continue to receive updates thanks to a few operating systems that shipped it as an integral library. Red Hat has committed to support it through June 2024. Debian is actively trying to remove it, but will likely maintain support into 2024.
But that doesn’t mean you should wait. Any shiny new Python libraries are probably going to be written in Python 3. So if you want to make the most out of the developing ecosystem, you should upgrade now. You don’t want to be forced to upgrade when a killer security hole hits the internet.
In academic circles, Python 2 may live on for decades, just as COBOL has done within large sectors of government and industry. It’s grown quite popular there, thanks to its powerful data manipulation and visualization capabilities. Anecdotally, researchers are starting new projects with Python 2. And the scripts produced for research projects often become obsolete once the project ends. Why update something for a project already completed?
But if you’re an educator teaching Python 2 over 3, you’re doing your students a disservice. Python 3 will be adapted for the changing needs of software engineering, reacting to new concepts and use cases, while Python 2 will be mostly frozen in amber.
So while Python 2 may live on sometime into the future, this marks its final chapter. Chances are pretty good that, at some point soon, you’ll need to move on to Python 3. That’s probably a good thing, as Python 3 is still an actively developed language. Raise a glass (or a class) to the end of Python 2 and think about refactoring your code to take advantage of the new features coming out.
Tags: python, stackoverflow
25 Comments
True, right after the follow up release of Python 2. Something tells me this bad boy is not going away just because a hard deadline was set.
Is there an official statement to whether they chose that version number specifically to reference the natural logarithm base (“e”)?
I’m not sure if they did it on purpose, but they definitely noticed it: https://lwn.net/Articles/818000/
They’re still four decimal places behind Knuth’s Metafont though: https://en.wikipedia.org/wiki/Metafont
Will the 3.14.15 be the last in the 3.x versions?
I’m wondering what will be the final version of Python 3, Python 3.14.15 or they’ll approximate to Python 3.14.16?
Clever you found that xD
Typo in second-to-last paragraph:
> while Python will be mostly frozen in amber.
should say
> while Python **2** will be mostly frozen in amber.
Is it a typo ? Paragraph just before last : “… while Python [2] will be mostly frozen in amber.” Missing the 2.
It’s simple to move from Python 2 to 3
Just folow below steps:
Pip install 2to3
2to3 -w [foldername]
Or
pip3 install 3to2
3to2 -w [foldername]
Python 2 has been obsolete since before I became a developer, and will still be getting updates after I’m dead.
Same same
Good decision by python
This is a clever comment. Congratulations.
I think there’s a word missing in the last sentence of the second paragraph:
“now might be a good time [to] put your plan into action. “
Fixed, thanks!
Python 2 still has a long way to go.
You can’t make old technology die just by declaring it dead; it doesn’t work that way. Look at XPath 1.0, superseded by a much more powerful 2.0 since 2007 yet still used more widely than later versions.
And TCP/IP is kind of a hack until we get a proper 7-layer OSI protocol stack written and widely adopted, and Linux is a temporary OS to use until the FSF completes GNU Hurd
Imagine killing stillborn technology
Ironic
This will do so much to close the divide within Python’s developer community. Every Language’s value has several key components. Syntax is a very important consideration; but the abundance of open-source Libraries is equally important. The #1 thing hurting the Python language and its “Library abundance” has been the far-to-often asked question “does the library I need/want run in Python 2.7 or 3.x”… drawing a close to that question will help the language thrive. The cord had to be cut!
Hi, can I translate it into Chinese and post it into csdn.net? The origin link will be displayed there.
Hi Eric — Unfortunately, our legal department does not allow translations of our articles.
What else does your legal department not allow? Linking? Referencing?
Does google translate (yes it’s not perfect) not count as translation?
Linking and referencing are fine, as is using Google Translate on the text. However, because the content is under our copyright, we cannot give permission to post a translated version on a blog or other web page.