How to Install Python on CentOS 8

Install Python on CentOS 8

In this article, we will have explained the necessary steps to install and configure Python on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Python is one of the most widely used programming languages in the world. Python is a quite versatile programming language, you can use it to do almost anything you want, write small scripts, build games, develop websites, create machine learning algorithms, analyze data and more.

Install Python on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install Python on CentOS 8.

The first thing to do is to install the packages necessary to build Python from the source code on CentOS:

Next, download Python using the following command from the Python official site:

Then, enter into the new directory that was just created and compile Python source code on your system using altinstall:

That’s it. Python 3.8 has been installed on your CentOS system, and you can start using it. Verify it by typing:

Congratulation, you have learned how to install and configure Python on CentOS 8. If you have any question, please leave a comment below.