This article will help you to install Python 3.8 from the source on your CentOS 8 and RHEL 8 Linux systems.

Prerequisites

First of all, log in to your CentOS 8 system with a root or sudo privileged account. Then use the following command to install the required development libraries for Python before installing it.

Downloading Python 3.8

You can download Python using the following command from its official site. We also recommend to visit python ftp directory to check for latest version. To download Python 3.8.5, use the following commands. Then, extract the downloaded archive on your system.

Install Python on CentOS 8

Switch to the extracted directory. Then configure the source files based on your system environment. After that use the following commands to compile Python source code on your system using altinstall. Now remove downloaded source archive file from your system

Test Python

Using the above installation, Python creates a separate binary file on your system. To use Python 3.8, you need to use a specific binary file. To test Python 3.8, execute:

Conclusion

In this tutorial, you have learned to install Python 3.8 on CentOS 8 from source code.