Python 3.9.0 released, how to install via PPA on Ubuntu

The Python programming language 3.9.0 has been released with new features and optimizations. To install on Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04 via PPA:

Python 3.9.0 is the default first version of the Windows 64-bit installer. Windows 7 is not supported.

Python 3.9.0 Release highlights:

  • Module state access from C extension method
  • Union operator of dict
  • Standard Collection Type Tips Generic
  • Flexible function and variable annotation
  • Python has a stable annual release rhythm
  • Relax decorator grammar restrictions
  • Support for IANA timezone databases in the standard library
  • String method to remove prefixes and suffixes
  • New PEG parser for CPython
  • Garbage collection does not block resurrected objects.
  • Added os.pidfd_open to allow process management without races or signals.
  • Unicode support has been updated to version 13.0.0.
  • Memory leaks will occur if Python is initialized multiple times in the same process.
  • Many Python built-in (range, tuple, set, frozenset, list, dict) have been accelerated using PEP 590 vectorcall.
  • Many Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use the multi-phase initialization defined in PEP489. It was.
  • Currently, many standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) use the stable ABI defined in PEP384.

How to install Python 3.9.0 on Ubuntu:

1.) Press Ctrl + Alt + T on your keyboard or search for “Terminal” in the System Application Launcher to open a terminal.

When the terminal opens, run the command to add “Dead Snake” Team PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

Enter your user password (without asterisk feedback) when prompted and press Enter to continue.

Python 3.9.0 released, how to install via PPA on Ubuntu

2.) Next, run the command to update the system package cache and install Python 3.9.

sudo apt update

sudo apt install python3.9

3.) After successful installation, check the Python version (python –version) of your system.

Python 3.9.0 released, how to install via PPA on Ubuntu

Four. ) (Deprecated) To use Python 3.9 as the default python3, Execute the command.

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2

For Ubuntu 16.04 and Ubuntu 18.04 python3.8 In code that uses the system’s default python3 version .. You can then use commands to switch between the two Python3 versions.

sudo update-alternatives --config python3

Python 3.9.0 released, how to install via PPA on Ubuntu

Note: Due to a known bug, if you change it, the terminal will not open python3 Symbolic link. The workaround is to use the command to recreate the symbolic link (replace python 3.8 with the default python3 version of your system).

sudo rm /usr/bin/python3; sudo ln -s python3.8 /usr/bin/python3


To uninstall the Python3.9 package, run the following command.

sudo apt remove --autoremove python3.9 python3.9-minimal

To remove Deadsnakes PPA[ソフトウェアとアップデート]Launch and[その他のソフトウェア]Go to the tab, then delete the repository row and close the window.