How to Install Python 3.10 Final in Ubuntu 20.04, Ubuntu 18.04

Last updated: April 24, 2024

The Python programming language 3.10 is finally released on Oct 6. Here’s how to install it via PPA in Ubuntu 20.04, Ubuntu 18.04, Linux Mint 19.x/20, and derivatives.

Python 3.10 has 18 months support with bug-fix updates until the next 3.11 release. After that, it will be supported with 5 years of security updates until October 2026.

New major features and changes compare to Python 3.9:

  • Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • Allow writing union types as X | Y
  • Parameter Specification Variables
  • Precise line numbers for debugging and other tools.
  • Add Optional Length-Checking To zip.
  • Parenthesized context managers are now officially allowed.
  • Deprecate distutils module.
  • Explicit Type Aliases
  • Structural Pattern Matching
  • Require OpenSSL 1.1.1 or newer
  • Remove Py_UNICODE encoder APIs
  • Add optional EncodingWarning

Install Python 3.10 via Ubuntu PPA:

The ‘Deadsnakes’ Team PPA has build the packages for current 2 Ubuntu LTS. NOTE for Ubuntu 16.04, the package stuck at Python 3.10 alpha 6 due to old SSL library.

1.) Open terminal from system application menu, and run command to add the PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

Type user password (no asterisk feedback) for sudo prompts and hit Enter to continue.

2.) Then refresh system package via command:

sudo apt update

3.) Finally install Python 3.10 via command:

sudo apt install python3.10

Once installed, check via python3.10 --version command or just run python3.10 to access the IDE in terminal.

Uninstall Python 3.10:

To remove the programming language, run command:

sudo apt remove --autoremove python3.10

And remove the Ubuntu PPA via Software & Updates utility under Other Software tab.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

2 responses to How to Install Python 3.10 Final in Ubuntu 20.04, Ubuntu 18.04

  1. Sergio Fernandez Testa May 10, 2021 at 11:58 pm

    Is it possible to replace previous version in order to use just python3 for running a program and also using pip

    • python3 by default is a symbolic link. You can make it link to python3.10, however some apps, e.g., Gnome-Terminal, will refuse to run.

      To do so, firstly check the default python3 version via command:

      ll /usr/bin/python3

      It’s python3.8 in Ubuntu 20.04, and python3.6 (maybe, I don’t remember) in Ubuntu 18.04.

      Secondly, add the two versions as alternatives to Python3 (replace python3.8 with python3.6 for 18.04):

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

      You can finally run command to select which to use as python3:

      sudo update-alternatives --config python3