请教下:
redhat 5.3 64位的系统

系统自带的python  2.4.3箭头和退格正常使用

#python
Python 2.4.3 (#1, Sep 17 2008, 16:07:0 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> daf   

但自定义安装的python 2.7.1退格键和箭头无法正常使用,如下:

#python
Python 2.4.3 (#1, Sep 17 2008, 16:07:0 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> daf ^H^[[D

google搜索,有所终端问题的。但更多说是readline库的问题。
但在系统里是能找到readline库的:
#      ll /usr/lib/libreadline.so.5*
lrwxrwxrwx 1 root root     18 Mar 12 02:57 /usr/lib/libreadline.so.5 -> libreadline.so.5.1
-rwxr-xr-x 1 root root 208808 Jul 13  2006 /usr/lib/libreadline.so.5.1

有点无法理解。
后重新编译、安装,发现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的开发包,安装之:
yum install readline-devel.x86_64

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

posted on 2013-02-06 17:28  一个人的天空@  阅读(4955)  评论(2编辑  收藏  举报