First step: Download python2.7 wget https://www.Python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
Step two: Unpack the compressed package that you just downloaded #tar-xvf python-2.7.12.tar.xz
Step three: Create a new installation directory Mkdir/usr/local/python27
Fourth step: Compile./configure--prefix=/usr/local/python27 #将安装路径指向刚创建的python路径
The configure:error:no acceptable C compiler found in $PATH, the compiler is wrong, need to install gcc-c++ compiler
Fourth Step error resolution Yum install gcc-c++ reinstall gcc-c++ Compiler
Fifth step: Make
Sixth step: Make install
Seventh step: renaming old python mv/usr/bin/python/usr/bin/python_old
Eighth step: Create a soft connection to the new Python point/usr/bin/python ln-s/usr/local/python27/bin/python2.7/usr/bin/python
All code
wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/2.7.12/PYTHON-2.7.12.TAR.XZ
TAR-XVF PYTHON-2.7.12.TAR.XZ
Mkdir/usr/local/python27
./configure--prefix=/usr/local/python27
Make
Make install
Mv/usr/bin/python/usr/bin/python_old
Ln-s/usr/local/python27/bin/python2.7/usr/bin/python
Linux re-install Python