Towards the retirement of Python2


It's been about 10 days this year. At the same time as the end of the 2010s, an era will end in the world of Python. Python 2.7, which has been supported for a long time, will end of life (EOL) on January 1, 2020. In other words, after that, even if a bug is found, a fixed version will not be released. Python 2.7 will be the last in the 2 Series and Python 2 will retire.

The first version of Python 2.7 came out on July 3, 2010, so I've been active for nine and a half years. Python 3 at that time was Version 3.1. From there, the version has come up to 3.8, and the number of minor versions has exceeded Python2.

In the 20-year history of Python2, 2.7 accounted for half of that, which was an unusual situation because Python3 was incompatible with Python2 and took a long time to migrate. Python 2.8 was not supposed to come out as declared in PEP-404, so it remains Python 2.7 I kept pulling. Actually, my first retirement was in 2015, but even in 2014, the transition wasn't progressing at all, and I postponed EOL for five years because I said "this is no good".

Initially, Python3 had performance issues, and I was one of those who stayed with Python2 for a long time. Over time, these issues were gradually resolved, and people began migrating only when well-known libraries became Python 3 compliant. It's not hard to imagine the hardships of those who have managed to retire in 10 years, but I was reminded that even good ones will not move unless the benefits of the transition exceed the costs associated with the transition. I will.

The end of Python 2 support does not mean that it will be unavailable immediately. On the other hand, even if there are bugs or security problems, it is not possible to use software that is not updated for commercial use, and even if it is non-commercial, there is the same possibility of suffering damage, so switching to Python 3 has not waited. I think.

I'm sure many people say that the Python they use is already Version 3, but one thing that is often overlooked is when they are used indirectly. If many tools depend on Python and you have them installed via a package manager, for example, you may be pulling Python2. For example, node.js and vim, which seem to be unrelated at first glance, also use python. As a result, the admins of each package manager are working hard to move packages that depend on Python2 to Python3. I have investigated the situation regarding Homebrew and Debian, so I would like to write about it.


In Homebrew, the package python refers to python3, and python2 is provided under the package name python @ 2. This python @ 2 package should be erased early in the new year like this Pull Request has already been issued. However, some packages still depend on this and must be resolved first. There is an issue for that at here, but when I look at it, some packages are still unsupported.

If you check the situation at hand, it will look like this.

$ brew uses [email protected]
git-remote-hg     [email protected]         mysql-utilities   pwntools          terminator
headphones        mkvtomp4          offlineimap       pygobject         volatility
hg-flow           molecule          ooniprobe         redo              vte

If you want to know if any of these include what you have installed, try brew uses --installed python @ 2. I had mysql-utilities installed. Apparently there are no more updates, and here suggests that you are being encouraged to move to the MySQL Shell, so I'd like to do that.

In addition, MacOS standard python seems to be 2.7 even in the latest Catalina. However, when I start it, the message "I don't recommend using Python 2.7!" Appears. It is said that it will be erased in the future, but I wonder if it will remain as it is until the next version comes out.


Debian is also trying to remove Python2. However, Debian has a long history and a large number of packages, which makes things more complicated. Packages affected by the removal of Python2 are registered with Debian's bug tracking system and are tagged as py2removal (Bugs tagged py2removal. .cgi? tag = py2removal; users = [email protected])), the total number is 3,443. Of these, 1,960 have been resolved. The remaining 1,483 packages are still open.

Those that are used infrequently or that have not been maintained upstream (developer) are subject to erasure, and many have already been erased. So, the remaining 1,500 packages contain some important things. In particular, there are more than 600 that are considered "serious" (the most serious), and python2 will probably not be erased unless these are resolved. There is no choice but to watch the trend how long it will take.

A quick glance at the open list reveals some familiar names. For example, trac. This is a ticket management tool, so to speak, a Python version of redmine. I used to use it a long time ago, but I heard the name after a long time. Looking upstream, a new version (1.4) came out in August of this year, but it is not yet compatible with python3. Looking at the roadmap, it seems that it will be supported in the next 1.6, but it is not in time at all. The development of Trac itself is done at Trac, but I can't deny that it's old. I thought it would be easier if I did it on Github, but then the significance of Trac's existence would be lost in the first place (laughs). After all, it makes me realize that software has a limited lifespan.

Also, the exchanges with each package maintainer are listed in the bug ticket, but it is quite violent. For example, Ticket for a package called Caliber says, "You can't do anything at all." Don't disperse FUD (fear, anxiety, doubt), "or rather strong words are lined up. It's a wasteful work that wouldn't be done if Python2 could be used as it is, so I'm not sure, but it feels like the merits and demerits of leaving Python2 in parallel with Python3 for a long time.

The future of Python 2.7

What will happen to Python 2.7 after January? Actually, PEP-373 has a release schedule in the future.

--2.7.18 Code Freeze ... January 2020 --2.7.18 Release candidate ... Early April 2020 --2.7.18 Official release ... Mid-April 2020

I thought it wasn't stopped in January, but it seems that there is only one last maintenance release. Homebrew will drop Python @ 2 anymore, so the next 2.7.18 may be a phantom version.


I checked the preparation status of Homebrew and Debian due to the retirement of Python2. I would like to keep an eye on what is actually going on after this.

You can see the countdown to retirement at

Recommended Posts

Towards the retirement of Python2
the zen of Python
About the ease of Python
About the features of Python
The Power of Pandas: Python
The story of Python and the story of NaN
[Python] The stumbling block of import
First Python 3 ~ The beginning of repetition ~
Existence from the viewpoint of Python
pyenv-change the python version of virtualenv
Change the Python version of Homebrew
[Python] Understanding the potential_field_planning of Python Robotics
Review of the basics of Python (FizzBuzz)
About the basics list of Python basics
Learn the basics of Python ① Beginners
Introduction of Python
Check the behavior of destructor in Python
[Python3] Understand the basics of Beautiful Soup
Pass the path of the imported python module
The story of making Python an exe
Learning notes from the beginning of Python 1
Check the existence of the file with python
About the virtual environment of python version 3.7
[Python] Understand the content of error messages
[Python3] Rewrite the code object of the function
I didn't know the basics of Python
Basics of Python ①
The result of installing python in Anaconda
Basics of python ①
[Python] Try pydash of the Python version of lodash
[python] Checking the memory consumption of variables
Check the path of the Python imported module
The story of manipulating python global variables
Copy of python
[python] [meta] Is the type of python a type?
The basics of running NoxPlayer in Python
Pandas of the beginner, by the beginner, for the beginner [Python]
The Python project template I think of.
In search of the fastest FizzBuzz in Python
Python Basic Course (at the end of 15)
Set the process name of the Python program
[Python] Get the character code of the file
The story of blackjack A processing (python)
Intuitively learn the reshape of Python np
Python Note: The secret role of commas
Learning notes from the beginning of Python 2
Introduction of Python
Japanese translation: PEP 20 --The Zen of Python
[Python3] Understand the basics of file operations
Get the contents of git diff from python
[Python] Read the source code of Bottle Part 2
[python] Check the elements of the list all, any
The story of low learning costs for Python
[Python] Sort the list of pathlib.Path in natural sort
Prepare the execution environment of Python3 with Docker
Summary of the differences between PHP and Python
2016 The University of Tokyo Mathematics Solved with Python
The contents of the Python tutorial (Chapter 5) are itemized.
The contents of the Python tutorial (Chapter 4) are itemized.
[Python] Get / edit the scale label of the figure
The contents of the Python tutorial (Chapter 2) are itemized.