The Python version installed on CentOS 6.3 is 2.6 and does not meet my requirements for running the software, so I upgrade Python.
The latest version of Python is already 3.3, but the compatibility of Python3 may have some problems, so it is more insurance to upgrade to 2.7. Python 2.7 is also capable of meeting most of the software requirements.
Official website Download Python2.7
https://www.python.org/
Dependency Packages
Yum Install zlib* gcc*
TAR-XVF python-2.7.3.tgz
CD Python-2.7.3
./configure--prefix=/usr/local/python2.7
Make
Make Install
once installed, you can run Python to see if it's working.
/usr/local/python2.7/bin/python2.7-v
other articles mention that Python is in the/usr/local/bin directory, but I did not find it, but in the/usr/local/python2.7/bin/.
Next you need to create a link to make the system default Python into python2.7.
Ln-fs/usr/local/python2.7/bin/python2.7/usr/bin/python
Run Python view version
python-v
after making the change, Yum does not run. Modify the/usr/bin/yum file to change the first line of the
#!/usr/bin/python
in Python to the original Python version of the system, my following:
#!/usr/bin/python2.6
This article is from the "XFICC" blog, make sure to keep this source http://xficc.blog.51cto.com/1189288/1566192
CentOS 6.3 on python2.6 upgrade to 2.7