Step 1 – Installing Prerequisite

As you are going to install Python 3.8 from the source. You need to install some development libraries to compile Python source code. Use the following command to install prerequisites for Python:

Step 2 – Download Python 3.8

Download Python source code using the following command from python official site. You can also download the latest version in place of the specified below. Then extract the downloaded source archive file

Step 3 – Compile Python Source

Use the below set of commands to compile Python source code on your system using the altinstall command.

Step 4 – Check Python Version

Check the installed version of python using the following command. As you have not overwritten the default Python version on the system, So you have to use Python 3.8 as follows: After successful installation remove the downloaded archive to save disk space

Conclusion

This tutorial helped you for installing Python 3.8 on Ubuntu, Debian, and Linux Mint systems by compiling it from source code.