Python 3.9 End of Life: What It Means and How to Upgrade

Python 3.9 reached end of life on 31 October 2025 and gets no more fixes. What that means for your code, which version to move to, and what breaks.

Python 3.9 is end of life: it reached the end of its support on 31 October 2025, and 3.9.25 was the final security release. Your code still runs, but nobody will fix a vulnerability found in the interpreter from now on, and the current releases of several major libraries no longer install on it.

For the dates of every version, see the Python end-of-life dates page. The versions that follow are covered in Python 3.10 end of life and Python 3.11 end of life.

Python 3.9 dates

Milestone Date
Released 5 October 2020
Last regular bugfix release (3.9.13) 17 May 2022
Final security release (3.9.25) 31 October 2025
End of life 31 October 2025

These come from PEP 596, the Python 3.9 release schedule. It states that the 3.9 codebase is now frozen and that no further updates will be provided, nor issues of any kind accepted on the bug tracker.

What end of life means

No fixes of any kind. A vulnerability or bug found in the interpreter after the end date stays open in 3.9.

Libraries move on. This is the minimum Python version of the latest release on PyPI, checked on 17 November 2026:

Package Latest version Requires Python
NumPy 2.5.5 3.12 or later
SciPy 1.18.1 3.12 or later
Django 6.1.3 3.12 or later
pandas 3.1.1 3.11 or later
Pillow 13.0.0 3.11 or later
scikit-learn 1.9.1 3.11 or later
Requests 2.34.2 3.10 or later
Flask 3.1.3 3.9 or later

A project pinned to 3.9 therefore stays on older releases of these libraries, which in turn stop receiving their own fixes. See Python dependency security for why that matters.

Check your platforms. Look at which Python versions your hosting runtime, CI images and base images still offer before you plan the move.

Which version to move to

Go straight to a supported version rather than stepping through 3.10, 3.11 and 3.12:

Target Status on 17 November 2026 End of life
3.13 Security fixes only (since 1 October 2026) October 2029
3.14 Bugfix releases October 2030
3.15 Bugfix releases, released on 9 October 2026 October 2031

For most projects 3.13 or 3.14 is the practical choice. NumPy, pandas, SciPy, Pillow, Matplotlib and scikit-learn already publish wheels for 3.15 on PyPI, so check your own dependency list rather than assuming it has to wait. See Python 3.14 vs 3.15 for the differences.

What breaks from 3.9

Most code upgrades cleanly. These are the removals worth searching your code for, by the version that made them (from the official What’s New pages):

Version Removed or changed
3.10 Aliases such as collections.Mapping (import from collections.abc); the loop parameter of most high-level asyncio functions
3.12 distutils, imp, asyncore, asynchat and smtpd; unittest aliases such as assertEquals and failUnless; setuptools is no longer installed in new virtual environments
3.13 19 modules under PEP 594, including cgi, cgitb, crypt, imghdr, pipes and telnetlib; also lib2to3 and the 2to3 tool
3.14 The asyncio child watchers, ast.Num and ast.Str, pkgutil.get_loader, urllib.request.URLopener; on Unix other than macOS the default multiprocessing start method is now forkserver

The first item is easy to see for yourself. On 3.9 the import still works but warns, and on 3.10 it fails:

$ python3.9 -W error -c "from collections import Mapping"
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

$ python3.10 -c "from collections import Mapping"
ImportError: cannot import name 'Mapping' from 'collections'

Running your test suite with warnings as errors on 3.9 first shows this kind of problem before you move: python -W error -m pytest. The newer interpreter will then show the removals above as import errors.

What you gain

Ruff can apply the syntax modernisation for you. With a Python 3.10 target, its UP rules flag Optional[int] and Union[int, str], and typing.List and typing.Dict are flagged once the target is 3.9 or later:

ruff check --select UP --target-version py310 --fix .

This was checked with Ruff 0.17.5: on a file using Optional[int], Union[int, str], List[int] and Dict[str, int], a Python 3.10 target reported UP045, UP007 and UP035, and a 3.9 target reported UP035 and UP006 only.

How to do it

  1. Find every place you run 3.9: environments, requires-python in pyproject.toml, Dockerfiles and CI.
  2. Install the target version. uv does this with uv python install 3.13.
  3. Recreate your virtual environment on the new version and reinstall dependencies.
  4. Run the tests with warnings as errors, fix what fails, and roll out.
  5. Raise requires-python to the new minimum so nobody installs your package on 3.9 by mistake.

Frequently Asked Questions

Is Python 3.9 end of life?

Yes. Python 3.9 reached end of life on 31 October 2025, and 3.9.25 was the final security release. The codebase is frozen: no further updates are provided and the core team accepts no bug reports for it.

Is it safe to keep using Python 3.9?

It still runs, but a vulnerability found in the interpreter will not be fixed in 3.9. Current releases of NumPy, pandas, SciPy and Django also no longer install on it. Treat it as technical debt to clear, especially for anything internet-facing.

Which Python version should I upgrade to from 3.9?

Python 3.13 (supported until October 2029) or 3.14 (supported until October 2030) for most projects. Python 3.15, released on 9 October 2026, is supported until October 2031. Moving straight to a current version avoids doing the upgrade twice.

What breaks upgrading from Python 3.9 to 3.10?

The long-deprecated aliases for the abstract base classes in the collections module, such as collections.Mapping, were removed, so imports must come from collections.abc. The loop parameter was also removed from most of the high-level asyncio API.

What new features do I get after leaving Python 3.9?

Structural pattern matching and X | Y union types in 3.10, exception groups, tomllib and an average 1.25x speed-up on the standard benchmark suite in 3.11, then a new interactive interpreter in 3.13 and template strings in 3.14.