1, first download Python 2.7.8 version of the TAR package. Why not choose the latest version of 3.4? Because the compatibility of version 3 is not good. A number of mature projects have been developed based on 2.7.
https://www.python.org/download/
After the download is found, it is uploaded to the server via the Linux RZ command, and you can also download it from the command wget.
2. The default download address is the home address of the current user. Next
TAR-XVF python-2.7.8. Tar
After decompression, enter the directory
CD python-2.7. 8
Build a folder in/usr/local before compiling python27 (as a Python installation path to avoid overwriting the old version)
cd/usr//usr/local/python3
CD ~
Start compiling the installation
1 ./configure--prefix=/usr/local/python323make45 Make install
It will take a few minutes and wait patiently
After that, put the previous backup under.
Mv/usr/bin/python/usr/bin/python_old
To create a new version of the link
Ln-s/usr/local/python27/bin/python2.7/usr/bin/python
Ok
Look again at the next
Upgrade CentOS python for 2.7 (CentOS python upgrade)