Python 3.9

Python 3.9 3.9.13

Python is a programming language that lets you work more quickly and integrate your systems more effectively.

Download for Windows

About Python 3.9

Python is a programming language that lets you work more quickly and integrate your systems more effectively.

What's new in 3.9.13

Core and Builtins
- gh-92311: Fixed a bug where setting frame.f_lineno to jump over a list comprehension could misbehave or crash.
- gh-92112: Fix crash triggered by an evil custom mro() on a metaclass.
- gh-92036: Fix a crash in subinterpreters related to the garbage collector. When a subinterpreter is deleted, untrack all objects tracked by its GC. To prevent a crash in deallocator functions expecting objects to be tracked by the GC, leak a strong reference to these objects on purpose, so they are never deleted and their deallocator functions are not called. Patch by Victor Stinner.
- gh-91421: Fix a potential integer overflow in _Py_DecodeUTF8Ex.
- bpo-46775: Some Windows system error codes(>= 10000) are now mapped into the correct errno and may now raise a subclass of OSError. Patch by Dong-hee Na.
- bpo-46962: Classes and functions that unconditionally declared their docstrings ignoring the --without-doc-strings compilation flag no longer do so.
The classes affected are pickle.PickleBuffer, testcapi.RecursingInfinitelyError, and types.GenericAlias.
The functions affected are 24 methods in ctypes.
Patch by Oleg Iarygin.
- bpo-36819: Fix crashes in built-in encoders with error handlers that return position less or equal than the starting position of non-encodable characters.
Library
- gh-91581: utcfromtimestamp() no longer attempts to resolve fold in the pure Python implementation, since the fold is never 1 in UTC. In addition to being slightly faster in the common case, this also prevents some errors when the timestamp is close to datetime.min. Patch by Paul Ganssle.
- gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify().
- gh-92049: Forbid pickling constants re._constants.SUCCESS etc. Previously, pickling did not fail, but the result could not be unpickled.
- bpo-47029: Always close the read end of the pipe used by multiprocessing.Queue after the last write of buffered data to the write end of the pipe to avoid BrokenPipeError at garbage collection and at multiprocessing.Queue.close() calls. Patch by Géry Ogam.
- gh-91910: Add missing f prefix to f-strings in error messages from the multiprocessing and asyncio modules.
- gh-91810: ElementTree method write() and function tostring() now use the text file’s encoding (“UTF-8” if not available) instead of locale encoding in XML declaration when encoding="unicode" is specified.
- gh-91832: Add required attribute to argparse.Action repr output. …

Full release notes »

Technical details

PublisherPython Software Foundation
Version3.9.13
Release date2022-05-17
LicensePSF-2.0
Installer typeburn
Architecturex86, x64
Package IDPython.Python.3.9
Install scopeCurrent user

Install Python 3.9 from the command line

Install with Windows Package Manager
winget install --id=Python.Python.3.9 -e
Update to the latest version
winget upgrade --id=Python.Python.3.9 -e
Uninstall
winget uninstall --id=Python.Python.3.9 -e
Silent install with the offline installer
"python-3.9.13-amd64.exe" /quiet /norestart InstallAllUsers=0 PrependPath=1
Install to a custom folder
"python-3.9.13-amd64.exe" DefaultJustForMeTargetDir=D:\Apps\Python 3.9
Uninstall the MSI package
msiexec /x {f599560c-4808-4daa-85d8-15f363099f67} /quiet

Python 3.9 adds these commands to the command line: py, python, pythonw, pyw.

languageprogrammingprogramming-languagepythonpython3script

File types supported by Python 3.9

Python 3.9 can open or be associated with 7 file types:

.py.pyc.pyd.pyo.pyw.pyz.pyzw

Python 3.9 version history

3.9.8 Nov 5, 2021
3.9.7
3.9.6

Other versions

  • 3.9.5
  • 3.9.4
  • 3.9.2
  • 3.9.1
  • 3.9.0

Frequently asked questions

Is Python 3.9 free?

Python 3.9 is psf-2.0 software from Python Software Foundation. Check the publisher's license terms for pricing and usage rights.

What is the latest version of Python 3.9?

The latest version is 3.9.13, released on May 17, 2022.

Is it safe to download Python 3.9?

The download button links to the official installer published on python.org, the same file Windows Package Manager installs. You can verify the downloaded file by comparing its SHA-256 checksum with fb3d0466f3754752ca7fd839a09ffe53375ff2c981279fd4bc23a005458f7f5d.

Which Windows versions does Python 3.9 support?

Python 3.9 runs on Windows and is available for 32-bit (x86), 64-bit (x64) systems.

How do I install Python 3.9 silently?

Run the offline installer with "python-3.9.13-amd64.exe" /quiet /norestart InstallAllUsers=0 PrependPath=1, or install it with Windows Package Manager: winget install --id=Python.Python.3.9 -e --silent.

How do I uninstall Python 3.9?

Open Settings › Apps › Installed apps, find Python 3.9 and select Uninstall. From the command line, run winget uninstall --id=Python.Python.3.9 -e.

What file types can Python 3.9 open?

Python 3.9 supports 7 file types, including .py, .pyc, .pyd, .pyo, .pyw, .pyz, .pyzw.