摘:https://blog.csdn.net/jcjc918/article/details/11022345
1.版本
[root@ARE88113415 ~]# python -VPython 2.6.6
2.升级操作
//依赖安装yum -y install wgetyum -y install makeyum -y install gccyum -y install opensslyum -y install openssl-develwget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 tar -jxvf Python-2.7.3.tar.bz2 cd Python-2.7.3 ./configure make all make install make clean make distclean
3.因为yum是不兼容 Python 2.7的,所以yum不能正常工作
vi /usr/bin/yum//将文件头部的#!/usr/bin/python//改成#!/usr/bin/python2.6.6
4。安装easy_install
wget -q http://peak.telecommunity.com/dist/ez_setup.pypython ez_setup.pycd Python-2.7.3 //进入python安装目录./configuremakemake install//成功编译之后在终端中输入,没有再出现错误,表示安装成功from urllib2 import urlopenurlopen("https://www.baidu.com")python ez_setup.py//centOS 安装pipwget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gztar -zvxf 1.5.5.tar.gzcd pip-1.5.5/python setup.py install
.配置iBus
//vi 打开下面两个文件,找到 exec python 那一行,把exec python 改为 exec python2.6 保存vi /usr/bin/ibus-setupvi/usr/libexec/ibus-ui-gtk