ImportError: No module named readline错误解决办法

作者:简简单单 2016-09-24

python版本是2.7.5,系统为centos7.x系列

错误代码:

[root@Shell site-packages]# python
Python 2.7.5 (default, Mar 18 2016, 16:51:30)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tab
Traceback (most recent call last):
  File "", line 1, in
  File "tab.py", line 4, in
    import readline
ImportError: No module named readline

解决方法:

[root@Shell site-packages]# cd /byrd/tools/
[root@Shell tools]# wget http://newcenturycomputers.net/projects/download.cgi/Readline-1.7.zip
[root@Shell tools]# unzip Readline-1.7.zip   
[root@Shell tools]# cd Readline-1.7
[root@Shell Readline-1.7]# python setup.py build
[root@Shell Readline-1.7]# python setup.py install

相关文章

精彩推荐