Centos5.7 comes with python version 2.4, which can be upgraded to 2.7 through source code compilation and installation. The source code can be downloaded from the official python website. after downloading and unzipping the source code, run :. /configuremakeallmakeinstallmakecleanmakedistclean is not surprising. you should be able to see the python2.7 file in/usr/local/bin/, which means 2.7 is successfully installed. The next step is
Centos5.7 comes with python version 2.4, which can be upgraded to 2.7 through source code compilation and installation. You can download the source code from the official python website. download and unzip the source code and run the following command:
./configuremake allmake installmake cleanmake distclean
The Python 2.7 File is displayed in/usr/local/bin/, indicating that the installation is successful. The next step is to enable the system to use 2.7 by default through soft links. The operation is as follows:
mv /usr/bin/python /usr/bin/bak_pythonln -s /usr/local/bin/python2.7 /usr/bin/python
Now, the upgrade is complete. However, because yum uses python 2.4, all yum instances are unavailable. to solve this problem, you only need to modify the/usr/bin/yum file, put the first line #! Replace/usr/bin/python #! /Usr/bin/python2.4.