免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 13602 | 回复: 3
打印 上一主题 下一主题

自定义安装python,退格,方向键无法正常使用(已解决) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-05-24 15:26 |只看该作者 |倒序浏览
请教下:
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,搞定!!

论坛徽章:
0
2 [报告]
发表于 2012-07-16 11:09 |只看该作者
多谢楼主分享,在centos6上编译了个python32,一直很少用没注意到有这个问题。刚试了下确实是这样,照楼主说的做确实可行,thanks

论坛徽章:
0
3 [报告]
发表于 2012-09-27 15:48 |只看该作者
退格什么的好用了但是......
[root@test ~]# python
Python 2.7.3 (default, Sep 27 2012, 14:34:40)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>> import os
>>> child = os.fork()
>>> >>>
>>> >>> >>> >>> >>> >>> >>> >>>

child = os.fork() ,这一行后按回车就这种效果了

论坛徽章:
1
2015亚冠之全北现代
日期:2015-10-22 14:29:41
4 [报告]
发表于 2016-01-11 17:26 |只看该作者
解决了我的问题,谢谢分享。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP