Install Python 3.7 on CentOS 7
CentOS series natively comes with Python 2 installed, since there are some system level parts are depending on python 2, it is not safe and easily to replace python 2 with python 3.
Therefore, this article would express install python with altinstall.
Step 1 Install dependency
yum install gcc openssl-devel bzip2-devel libffi-devel wget
Step 2 Download Python 3 source code
cd ~ wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz tar xzf Python-3.7.2.tgz
Step 3 Install
cd Python-3.7.2.tgz ./configure --enable-optimizations make altinstall
Note, if you encountered some error message such as no permission, please use
python3.7 -V Python 3.7.2 python -V Python 2.7.5