Upgrade Python2.6.6topython2.7.3 under Centos6.5. for me who don't use Pyhthon, the Python version has little to do with me, but I used to use SSH and suddenly wanted to switch to GoAgent, I suddenly realized that my Python version was too low and I upgraded it. Update History 1. download Python-2.7.3wgethttp: // pyt
Upgrade Python 2.6.6 to python 2.7.3 under Centos6.5
For me who won't use Pyhthon, the Python version has little to do with me, but I used to use SSH and suddenly wanted to switch to GoAgent, I suddenly realized that my Python version was too low and I upgraded it.
The following are the update records
1. download the Python-2.7.3
Wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
2. decompress Python-2.7.3
Tar-jxvf Python-2.7.3.tar.bz2
3. install Python-2.7.3
At this point, it should also go smoothly, but at the end, it prompts "ImportError: No module named _ ssl ".
Ssl is installed by default.
3.1 First install the openssl package
Yum install openssl-devel-y
3.2 enable ssl
Vim/usr/software/Python-2.7.5/Modules/Setup. dist
Find the SSL-related part and remove the comment.
# The modification result is as follows:
# Socket module helper for socket (2)
_ Socket socketmodule. c timemodule. c
# Socket module helper for SSL support; you must comment out the other
# Socket line above, and possibly edit the SSL variable:
# SSL =/usr/local/ssl
_ Ssl. c \
-DUSE_SSL-I $ (SSL)/include/openssl \
-L $ (SSL)/lib-lssl-lcrypto
3.3 install Python
./Configure
Make all
Make install
Make clean
Make distclean
3.4 view the Python version just installed
/Usr/local/bin/python2.7-V
3.5 but python-V is still 2.6.6. in this case, we need to point the default python version to version 2.7.
Mv/usr/bin/python/usr/bin/python2.6.6
Ln-s/usr/local/bin/python2.7/usr/bin/python
Then you can use python-V to view the result and it will be displayed as 2.7.3.
4. after the system python soft link points to python 2.7, yum cannot work normally.
Vim/usr/bin/yum
Place
#! /Usr/bin/python
Change
#! /Usr/bin/python2.6.6