Python 2 / PyPy removal help page




Python 2 Countdown:

Common mistakes made when removing Python2 packages

Here are some issues seen for ongoing removal of Python2 packages:

Check list

Quick list of things to do while removing Python / ?PyPy binary package:

How to check for reverse dependencies

For a quick initial check / if you're looking for a package to work on, see look for binary (not source) packages with 0 in the rdeps column.

To search for all runtime Depends/Recommends, and all mentions in the Sources index (Build-Depends*, Testsuite-Triggers, and the package itself):

Here python-$module is a binary package name.

grep-dctrl -w -F Pre-Depends,Depends,Recommends -s Package "python-$module" /var/lib/apt/lists/*_debian_dists_{unstable,sid}_main_binary-amd64_Packages 
grep-dctrl -w -s Package "python-$module" /var/lib/apt/lists/*_debian_dists_{unstable,sid}_main_source_Sources


The alternative of "apt-cache rdepends python-$module ; reverse-depends -b python-$module" (ubuntu-dev-tools package) can be slow and does not find autopkgtest depends.

usertags (

PLEASE, when changing user tags, please CC the bug report, because it's non-obvious who is changing a user tag by reading the bug report.

Every package should be tagged with:

Add more tags for better classifications:


My package is affected only because it uses python-sphinx to generate documentation, what should I do?

just replace it with python3-sphinx, and in debian/rules, you can invoke Sphinx this way (the team do not recommand using the 'sphinx-build' command):

python3 -m sphinx

I hear there will still be a Python 2 interpreter in bullseye, can I use that in my package?

No you can't. From #975014:

Debian Bullseye includes a version of Python 2.7 (and a short list of
related packages like setuptools still built Python 2 packages). However, these
are only included for building a few applications which still require
Python 2 as part of their build process. Python 2 is not supported for
running applications and there won't be any security updates for Python
2 in Bullseye.


>  - bumping lintian info to warn, warn to error, ask ftp-master
>    to autoreject packages for some errors?