Centos 7.5 ships with the outdated Python 2.7 but the current version is 3.7. This guide will show you how to install Python 3.7 on Centos 7.5 in just a few easy steps.
Run the following command to install prerequisites for Python 3.7
yum install gcc openssl-devel bzip2-devel libffi-devel
Download Python 3.7
Lets download Python 3.7 to our server and extract it.
cd /usr/src wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz tar xzf Python-3.7.0.tgz
Install Python 3.7 on Centos 7.5
Installing is as easy as running the following commands:
cd Python-3.7.0 ./configure --enable-optimizations make altinstall
now we can clean up the downloaded file:
rm -f /usr/src/Python-3.7.0.tgz
and now we can test to make sure it was installed correctly:
Which should return:
You now have the latest version of Python installed on Centos 7.5!