码迷,mamicode.com
首页 > 编程语言 > 详细

python退格、方向键无法正常使用解决方法

时间:2015-02-06 10:48:31      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:

CentOS 6.5 自带的Python 2.6.6 箭头以及退格键(Backspace)可正常使用:

技术分享

自定义所安装的Python 2.7.6却发现箭头以及退格键(Backspace)在使用的时候出现异常:

技术分享

这是由于新升级的Python2.7.6缺少readline开发包的原因:

后重新编译、安装Python 2.7.6,发现make install的时候,最后确实提示缺少readline库:
----------------------------------------------------------------------------------------------------------------
Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _curses            _curses_panel   
_sqlite3           _tkinter           bsddb185        
bz2                dbm                dl              
gdbm               imageop            sunaudiodev     readline
----------------------------------------------------------------------------------------------------------------

因此我们需要安装readline开发包,并重新对Python 2.7.6进行编译安装:

shenweiyan@localhost 09:28:40 ~ 
=> yum install readline-devel.x86_64

shenweiyan@localhost 09:28:40 ~
=> yum list|grep readline
readline.x86_64                            6.0-4.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
readline-devel.x86_64                      6.0-4.el6                      @bgios
compat-readline5.i686                      5.2-17.1.el6                   bgios
compat-readline5.x86_64                    5.2-17.1.el6                   bgios
compat-readline5-devel.i686                5.2-17.1.el6                   bgios
compat-readline5-devel.x86_64              5.2-17.1.el6                   bgios
compat-readline5-static.x86_64             5.2-17.1.el6                   bgios
libreadline-java.x86_64                    0.8.0-24.3.el6                 bgios
libreadline-java-javadoc.x86_64            0.8.0-24.3.el6                 bgios
readline.i686                              6.0-4.el6                      bgios
readline-devel.i686                        6.0-4.el6                      bgios
readline-static.x86_64                     6.0-4.el6                      bgios
tcl-tclreadline.i686                       2.1.0-3.el6                    epel 
tcl-tclreadline.x86_64                     2.1.0-3.el6                    epel 
tcl-tclreadline-devel.i686                 2.1.0-3.el6                    epel 
tcl-tclreadline-devel.x86_64               2.1.0-3.el6                    epel

再重新configure、make、make install,搞定!!

python退格、方向键无法正常使用解决方法

标签:

原文地址:http://www.cnblogs.com/shenweiyan/p/4276407.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!