【问题标题】:getting ipython3 to use readline in ubuntu linux让 ipython3 在 ubuntu linux 中使用 readline
【发布时间】:2013-05-17 03:53:43
【问题描述】:

我在ubuntu 上安装了python3.3.1(虽然默认是python2.6.5)。我通常使用virtualenvwrapper 工作。

我想安装支持python3的ipython。所以我这样做了

>>workon envpy331
(envpy331)damon@ubuntu:~$
(envpy331)damon@ubuntu:~$pip install ipython
....

安装完成后,我试了

(envpy331)damon@ubuntu:ipython3
(envpy331)damon@ubuntu:

WARNING: IPython History requires SQLite, your history will not be saved
Python 3.3.1 (default, Apr 19 2013, 11:41:37) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
WARNING: Readline services not available or not loaded.WARNING: The auto-indent feature requires the readline library

看到这个我尝试安装readline

(envpy331)damon@ubuntu:pip install readline

此下载并尝试安装 readline 但失败

/usr/bin/ld: cannot find -lncurses

collect2: ld returned 1 exit status

error: command 'gcc' failed with exit status 1

当我试图定位libncurses时,我发现系统中安装了版本5

:locate libncurses

>>/lib/libncurses.so.5
/lib/libncurses.so.5.7
/lib/libncursesw.so.5
/lib/libncursesw.so.5.7
/usr/lib/vlc/plugins/gui/libncurses_plugin.so
/usr/share/doc/libncurses5
/usr/share/doc/libncursesw5
/usr/share/doc/libncurses5/FAQ
/usr/share/doc/libncurses5/README.Debian
/usr/share/doc/libncurses5/TODO.Debian
/usr/share/doc/libncurses5/changelog.Debian.gz
/usr/share/doc/libncurses5/copyright
/usr/share/doc/libncursesw5/changelog.Debian.gz
/usr/share/doc/libncursesw5/copyright
/var/lib/dpkg/info/libncurses5.list
/var/lib/dpkg/info/libncurses5.md5sums
/var/lib/dpkg/info/libncurses5.postinst
/var/lib/dpkg/info/libncurses5.postrm
/var/lib/dpkg/info/libncurses5.shlibs
/var/lib/dpkg/info/libncursesw5.list
/var/lib/dpkg/info/libncursesw5.md5sums
/var/lib/dpkg/info/libncursesw5.postinst
/var/lib/dpkg/info/libncursesw5.postrm
/var/lib/dpkg/info/libncursesw5.shlibs

知道如何纠正这个问题吗?

【问题讨论】:

    标签: python ipython readline


    【解决方案1】:

    您已安装 ncurses 库,但未安装编译 readline 所需的开发头文件。

    尝试安装libncurses5-dev,然后它应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-03
      • 2012-01-29
      • 2012-08-10
      • 1970-01-01
      • 2014-09-15
      • 1970-01-01
      • 2012-06-15
      • 2023-03-20
      相关资源
      最近更新 更多