Centos6.5下升级Python 2.6.6 to python 2.7.3
2013-12-07 10:46
387 查看
Centos6.5下升级Python 2.6.6 to python 2.7.3
对于一个不会使用Pyhthon的我来说,Python的版本实在与我得关系不大,只是以前一直用SSH突然想换到GoAgent,突然发觉自己得Python版本过低就将其升级了下。以下为升级记录
1.下载Python-2.7.3
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2[/code]
2.解压Python-2.7.3tar -jxvf Python-2.7.3.tar.bz2
3.安装Python-2.7.3
此时应该也是顺利进行,但是到最后却提示“ImportError: No module named _ssl”。
原来默认是安装ssl的。
3.1 首先要先安装openssl包yum install openssl-devel -y
3.2 开启sslvim /usr/software/Python-2.7.5/Modules/Setup.dist
找到SSL相关部分去掉注释就行#修改结果如下: # 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 _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto
3.3 安装Python./configure make all make install make clean make distclean
3.4 查看刚刚安装得Python版本/usr/local/bin/python2.7 -V
3.5 但是使用python -V查看得时候还是2.6.6,此时我们需要将系统默认的python指向到2.7版本。mv /usr/bin/python /usr/bin/python2.6.6 ln -s /usr/local/bin/python2.7 /usr/bin/python
然后通过python -V查看就会显示为2.7.3了。
4 .解决系统python软链接指向python2.7版本后,yum不能正常工作vim /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6
相关文章推荐
- centOS 6.4 升级python 2.6.6 to 2.7.3
- Centos 6.4 python 2.6.6 升级到 2.7.3
- 【python】python版本升级2.6.6到2.7.3(CentOS release 6.2)
- centos 6.4x64 django开发环境搭建(升级python2.6.6为2.7.3)
- centos6.5下如何把python2.6.6升级到2.7
- centos6.5下python2.6.6版本升级Python2.7.6安装过程
- Centos 6.5 python 2.6.6 升级到 2.7.3,并安装easy_install和pip工具过程
- CentOS环境 升级Python2.6.6至2.7.5
- CentOS 6.3 64bit上升级系统默认Python 2.6.6到2.7.10版本
- Centos python2.6.6升级2.7.14
- Centos 6.8升级Python2.6.6至2.7.8
- CentOS6.5自带Python2.6.6升级至Python2.7
- Python2.6.6升级2.7.3
- centos6.5系统将Python2.6.6升级到3.6.3版本
- 将CentOS 6.7默认的Python 2.6.6升级为2.7.4版本
- CentOS环境 升级Python2.6.6至2.7.5
- CentOS6.4升级python2.6.6到3.3.0
- How to install Python 2.7.3 on CentOS 6.2
- CentOS环境 升级Python2.6.6至2.7.6
- RHEL6.4上升级python从2.6.6到2.7.3