How-To Install Python 3.7 on Centos 7.5

Spread the love

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.

Install Requirements

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:

python3.7 -V

Which should return:

Install Python 3.7 on Centos 7.5

You now have the latest version of Python installed on Centos 7.5!


Spread the love

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
2 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
pahlawantojose Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
jose
Guest
jose

I didn’t worked for me
bash: python3.7: command not found
I think you missed something

pahlawanto
Guest
pahlawanto

cp /usr/src/Python-3.7.0/python /usr/bin/python3.7