Install Python3 on Linux 7


Install Python 3 on RHEL 7 with the yum 


Steps:

1  Update the package list 
$ sudo yum update

2 Install latest Python3 using below command:

$ sudo yum install python3


3 Verify it by checking the version of installed Python:
$ python3 --version
output:
Python 3.8.0



Installing Python 3.8 on Linux  7 from source

1 Update packages and install pre-requisites
$ sudo yum update
$ sudo yum install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel

2 Download Python 3.8 source code from the Python download page by using wget command, as shown below:
cd /usr/src 
$ wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

3 Extracts the gzipped file using the following command:
$ tar -xf Python-3.8.0.tgz

4 Go inside the extracted Python source directory and run the configure script to check the system compatibilities, and dependencies to build Python on your system.

$ cd Python-3.8.0
$ ./configure --enable-optimizations
Using --enable-optimizations option to optimize Python binary by running multiple tests, this process may take a longer time. 


5 Start Python 3.8 build process using make command as shown below:
$ make -j 8

6 Install Python binaries by using the following command:
$ sudo make altinstall

7 Now remove downloaded source archive file from your system
rm Python-3.8.0.tgz

8) Check version of Python using the following command:

$ python3 --version

output:
Python 3.8.0




If you like please follow and comment