Centos6.5下升级Python 2.6.6 to python 2.7.3
来源:互联网 发布:网络聊天搭讪 编辑:程序博客网 时间:2024/05/16 09:57
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
2.解压Python-2.7.3
tar -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 开启ssl
vim /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
./configuremake allmake installmake cleanmake 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.6ln -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
- Centos6.5下升级Python 2.6.6 to python 2.7.3
- Centos6.5 python 2.6.6升级2.7
- Centos6.6下升级Python
- centos6.5 升级 Python
- CentOS6.5 升级 Python 2.7 版本
- CentOS6.5 升级 Python 2.7 版
- CentOS6升级Python到2.7.3版本
- 在Centos6.5下升级python至3.6.0
- centOS 6.4 升级python 2.6.6 to 2.7.3
- CentOS6 升级python
- CentOS6.4升级Python
- CentOS6.X升级Python
- CentOS6.3升级Python到2.7.3版本
- CentOS6.3环境中,升级Python到2.7.3版本
- python在centos6.5上的升级
- centos6下升级python导致yum无法使用的解决办法
- How to Install Python 2.7 on CentOS6.5
- python 2.6 升级 2.7
- have a close looke at kideny of huamn
- x64 调用约定概述
- Deferred Shading
- Android 通过PHP连接Mysql
- 寒江独钓-键盘过滤学习1传统型的键盘过滤
- Centos6.5下升级Python 2.6.6 to python 2.7.3
- fork调用的形象描述
- ARM 中 CPSR_cxsf的意义
- 在PL/SQL中调用存储过程--oracle
- Errors running builder 'DeploymentBuilder' on project
- FLEX学习-4 FABridge技术
- 关于信噪比SNR【转载】1.http://well3216.blog.sohu.com/96624202.html
- android 四大组件之一 BroadcastReceiver 广播接收者
- 我的Android进阶之旅------>Android图片处理(Matrix,ColorMatrix)