Ipython no readline available 和 pip install readline 错误

发布于 2024-11-19 02:22:16 字数 1760 浏览 3 评论 0原文

我安装了 ipython 但它没有 readline 选项。我首先下载了gnu readline并编译安装。不知道这是否是一个正确的解决方案,但这是我首先想到的。它仍然无法正常工作,并出现与以前相同的错误:

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

然后我尝试使用 pip install readline 并收到以下错误。任何帮助将不胜感激:

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

I installed ipython but it doesn't have the readline option. I first downloaded gnu readline and compiled and installed. 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. 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

謸气贵蔟 2024-11-26 02:22:16

tmaric 是正确的。我在安装 iPython(Ubuntu 12.10,Quantal,32 位)时遇到了同样的问题。我缺少 ncurses5 库的开发版本。尝试:

sudo apt-get install libncurses5-dev

然后通过 pip 再次安装 readline 模块

pip install readline

tmaric is right. I had the same problem while installing iPython (Ubuntu 12.10, quantal, 32-bit). I was missing the dev version of the ncurses5 library. Try:

sudo apt-get install libncurses5-dev

and then installing the readline module again through pip

pip install readline
拥抱没勇气 2024-11-26 02:22:16

您遇到链接器错误:未安装库 ncurses,或者已安装库 ncurses,但链接器正在搜索错误的目标文件。

您使用什么平台/操作系统?

如果您运行的是 Linux/Unix,请尝试:

locate libncurses

查看该库是否已安装。如果您的系统上没有 libncurses*.{o,so,so.[0-9].[0-9]} 文件,只需安装库和 readline 即可。如果有,则检查 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.

What platform/operating system are you using?

If you're running Linux/Unix, try:

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. 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.

耶耶耶 2024-11-26 02:22:16

我在尝试安装一些 python 库时在 Ubuntu 14.04 安装中遇到了同样的问题。我相信 iPython 需要 readline,这对我来说是失败的,直到我运行以下命令。

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

I had the same issue with my Ubuntu 14.04 install trying to get some python libraries installed. iPython I believe requires readline which was failing for me until I ran the following commands.

sudo apt-get install python-dev
sudo apt-get install libncurses5-dev
sudo pip install readline
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文