Long time not to write blog, this article has no gold content, just make a record. Easy to read in the future.
0. Operating System Information
[Email protected] ~]$ cat/etc/issue
CentOS Release 6.4 (Final)
Kernel \ r on an \m
1. Current Python version information
[Email protected] bin]$ pwd
/usr/bin
[[email protected] bin]$ ll-a python
-rwxr-xr-x. 2 root root 4864 February python
[[email protected] bin]$ python
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>>
2. Delete the current Python
[[email protected] bin]$ sudo rm-rf python
3. Download and install the 2.7.6 installation package
[email protected] download]$ ll python-2.7.6.tgz
-rw-r--r--1 vagrant vagrant 14725931 May python-2.7.6.tgz
[[email protected] python-2.7.6]$./configure && make && sudo make install
4. Making a soft connection point python2.7.6 to Python
[[email protected] bin]$ sudo ln-s/usr/local/bin/python2.7 python
[Email protected] bin]$ pwd
/usr/bin
[[email protected] bin]$ ll python
lrwxrwxrwx 1 root root 24 February 14:29 python --/usr/local/bin/python2.7
OK, now the Python environment is switched to 2.7.6.
[[email protected] ~]$ python
Python 2.7.6 (default, Feb 14 2015, 14:13:13)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>>
Centos6.4 on python2.6.6 upgrade to 2.7.6