As of today, Python 3.9 is the latest stable version available for productions environments. Most of the Debian-based Linux distribution includes older versions of Python in software repositories. Also, the Debian packages are not available for all distributions. In this tutorial, you will learn to compile Python 3.9 from source code and install it on Debian-based systems. This tutorial will help you to how to install Python 3.9 on Ubuntu, Debian, and LinuxMint systems using source code.
Prerequisites
Login to the Debian system with sudo privileged account access. Open a terminal (CTRL+ALT+T) and execute the below commands to update packages. Then install the required packages for the compilation of Python source code.
Installing Python 3.9 with Source
Download the latest Python version source code from the official websites. Then compile the source code for your system and install it. Follow the below steps to install Python 3.9 on Debian systems: Wait for the Python installation to complete on your system.
Check Python Version
At this step, you have successfully installed Python 3.9 on Debian 10 system. You need to type python3.9 to use this version. For example, to check the Python version, execute: This will also install pip for Python 3.9. That’s it, You have successfully installed Python 3.9 on Debian 10 system.
Conclusion
In this tutorial, you have learned to install Python 3.9 on Ubuntu, Debian, and LinuxMint systems using source code. You can try Python examples via command line.