源码安装python2.7
1、解决pip zipimport.ZipImportError: can’t decomPRess data; zlib not available E: The package lists or status file could not be parsed or opened.问题 ./configure –prefix配置后 找到Modules/Setup,找到463行左右
#zlib zlibmodule.c -I
去掉注释变为:
zlib zlibmodule.c -I
升级CentOS中的Python到2.7.6版本后发现Python在交互模式下方向键显示乱码。网上搜索了一下,有说是终端问题的,但更多说是readline库的问题。由于系统缺少了readline相关模块,CentOS 6.5默认只安装了readline模块而没有安装readline-devel模块,所以只要安装下即可。
[root@CentOS ~]# yum list | grep readline readline.i686 6.0-4.el6 @anaconda-CentOS-201311271240.i386/6.5 readline-devel.i686 6.0-4.el6 @base compat-readline5.i686 5.2-17.1.el6 base compat-readline5-devel.i686 5.2-17.1.el6 base compat-readline5-static.i686 5.2-17.1.el6 base libreadline-java.i686 0.8.0-24.3.el6 base libreadline-java-javadoc.i686 0.8.0-24.3.el6 base readline-static.i686 6.0-4.el6 base 1 [root@CentOS ~]# yum install readline-devel -y 安装完成readline-devel后,再重新编译安装Python2.7.6即可解决问题
Modules/Setup取消注释166行 readline readline.c -lreadline -ltermcap
[root@CentOS Python-2.7.6]# configure [root@CentOS Python-2.7.6]# make && make install
问题解决
然后重新编译安装
新闻热点
疑难解答