简体   繁体   English

Ipython没有可用的readline和pip安装readline错误

[英]Ipython no readline available and pip install readline error

I installed ipython but it doesn't have the readline option.我安装了 ipython 但它没有 readline 选项。 I first downloaded gnu readline and compiled and installed.我首先下载了 gnu readline 并编译安装。 DIdn't know whether it was a proper solution but was the first thing I thought of.不知道这是否是一个合适的解决方案,但这是我想到的第一件事。 It still wouldn't work to no avail with the same error as before:由于与以前相同的错误,它仍然无济于事:

WARNING: Readline services not available on this platform.
WARNING: The auto-indent feature requires the readline library

Then I tried using pip install readline and I get the error below.然后我尝试使用 pip install readline 并收到以下错误。 Any help would be appreciated:任何帮助,将不胜感激:

running install

running build

running build_ext

building 'readline' extension

creating build

creating build/temp.linux-x86_64-2.6

creating build/temp.linux-x86_64-2.6/Modules

creating build/temp.linux-x86_64-2.6/Modules/2.x

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/home/jspender/include/python2.6 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.6/Modules/2.x/readline.o -Wno-strict-prototypes

creating build/lib.linux-x86_64-2.6

gcc -pthread -shared build/temp.linux-x86_64-2.6/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -L/home/jspender/lib -lncurses -lpython2.6 -o build/lib.linux-x86_64-2.6/readline.so

/usr/bin/ld: cannot find -lncurses

collect2: ld returned 1 exit status

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /home/jspender/bin/python2.6 -c "import setuptools;__file__='/home/jspender/build/readline/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-lBWIOm-record/install-record.txt failed with error code 1
Storing complete log in /home/jspender/.pip/pip.log

tmaric is right. tmaric是对的。 I had the same problem while installing iPython (Ubuntu 12.10, quantal, 32-bit).我在安装 iPython(Ubuntu 12.10,quantal,32 位)时遇到了同样的问题。 I was missing the dev version of the ncurses5 library.我错过了 ncurses5 库的开发版本。 Try:尝试:

sudo apt-get install libncurses5-dev

and then installing the readline module again through pip然后通过 pip 再次安装 readline 模块

pip install readline

You have a linker error: library ncurses is not installed, or it is installed and the linker is searching for the wrong object file.您有 linker 错误:库 ncurses 未安装,或者已安装并且 linker 正在搜索错误的 object 文件。

What platform/operating system are you using?您使用的是什么平台/操作系统?

If you're running Linux/Unix, try:如果您正在运行 Linux/Unix,请尝试:

locate libncurses

to see if the library is installed.查看是否安装了库。 If there are no libncurses*.{o,so,so.[0-9].[0-9]} files on your system, just install the library, and the readline.如果您的系统上没有 libncurses*.{o,so,so.[0-9].[0-9]} 文件,只需安装库和 readline。 If there are some, then check which one is searched for by the readline compilation process, it could be that you just have to make a symbolic link, naming the library file properly.如果有,请检查 readline 编译过程搜索的是哪一个,这可能是您只需要创建一个符号链接,正确命名库文件即可。

I had the same issue with my Ubuntu 14.04 install trying to get some python libraries installed.我的 Ubuntu 14.04 安装尝试安装一些 python 库时遇到了同样的问题。 iPython I believe requires readline which was failing for me until I ran the following commands.我相信 iPython 需要 readline,这对我来说是失败的,直到我运行以下命令。

sudo apt-get install python-dev
sudo apt-get install libncurses5-dev
sudo pip install readline

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM