I don't know why. centos 5.4 is used. The default Python version is 2.4. however, python is very important in centos, but Python 2.4 does not have many modules. The latest Python 2.6 version adds many advanced features. therefore, it is necessary to upgrade.
There are many ways to upgrade, one is to directly rpm, and the other is the source code method. The source code is indeed good, but it is troublesome and requires compilation, which is quite troublesome.
On the Internet, I found out how to create an RPM package for python 5.4 Under centos 2.6.
1. Download the source code from the official website.
CD/usr/src/rehat/sources
Wget http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2
Tar jxvf Python-2.6.5.tar.bz2
CP Python-2.6.5/MISC/RPM/python-2.6.spec ../specs
Rm-RF Python-2.6.5
CD ../specs
2. Start Compilation
Rpmbuild-Ba python-2.6.spec
3. After a long wait, there will be a compiled RPM package in the RPM folder.
The method for installing source code is not described in the old steps.