How to Install Python 3.8 on RHEL/CentOS 8

Python is opensource, most widely used programming language across the globe. It is very simple and easy to learn. Python is platform independent high level programming language. It is developed  by Guido van Rossum in 1989 and first released in 20th Feb 1991. In this article you will learn how to install Python 3.8 from source on your RHEL/CentOS 8 Linux machines.

Prerequisite

  • RHEL/CentOS 8 Machine
  • User with root or sudo privileges.

Before installing Python, a few development libraries are required to compile the source. Then use the following command to install them:

$  sudo dnf install gcc openssl-devel libffi-devel bzip2-devel wget

Downloading Python 3.8 Source Code

You can download Python from its official site. You have to visit python official site and click on Downloads and navigate to Python for Linux/Unix and copy the url of latest stable release. To download Python 3.8.5, use the below command.

$  cd /opt
$  wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

Next, extract the downloaded python archive in your machine using below commands:

$  tar xzvf Python-3.8.5.tgz

Compile and Install Python

Now enter into extracted directory and configure the source code files based on your system environment. If your system does not have any previous version of python i.e fresh installation then you can compile using make install otherwise it is recommended to use altinstall if your system has any previous versions of Python to overcome conflicts.

$  cd Python-3.8.5/
$  sudo ./configure --enable-optimizations 
$  sudo make altinstall

Verify Python Installation

Python installation with altinstall creates a separate binary file on your machine. To use Python 3.8, you need to use that specific binary file. To verify the Python 3.8 installation, you can use below command:

$  python3.8 --version or  python3.8 -V

#output
Python 3.8.5

Conclusion

Finally, you have python3.8 installed in your machine and you are ready to conquer the programming world. In this tutorial, you learned how to install Python 3.8 from source on your RHEL/CentOS 8.

Read More : How to Install Python 3.8 on Windows

 

Share on:

Ravindra Kumar

Hi, This is Ravindra. I am founder of TheCodeCloud. I am AWS Certified Solutions Architect Associate & Certified in Oracle Cloud as well. I am DevOps and Data Science Enthusiast.

Recommended Reading..

1 thought on “How to Install Python 3.8 on RHEL/CentOS 8”

Leave a Comment