Install Python 3 Version Using Source Code and Yum On Linux
The default version of python we found on the Linux is 2.7. we have to install the latest version. We can install and upgrade the existing version to python 3 using source code on Centos.
we will update the environment using yum update -y and if you’ve got the fresh Linux installed.
Install the python package using the below commands. This will install the python 3.6 version.
yum install python3
when you’re upgrading the python, it does not touch your current files that exist on the machine. We can check using python3 –version.
We can also enter in python terminal using /usr/bin/python3.6.
Install Python 3.8 On Centos Using Source Code
Before going onwards, there’re a few dependencies that we have to install using the command line.
yum install gcc openssl-devel bzip2-devel libffi-devel
Once all packages installed then download the file using the below command.
Extract the package and move it into your folder.
tar -xvf Python-3.8.1.tgz mv Python-3.8.1 /opt/ cd /opt/Python-3.8.1 ls
Now I’m going to compile python using the below command.
After compilation of the code, if you require to have the older version, we can keep it without replacing the older one using it.
we will check the current version installed on the machine.
You’re done upgrade to python 3 version