在mac上安装带有readline的ipython [英] Installing ipython with readline on the mac
问题描述
我在Mac OS 10.5上使用ipython和python 2.5.1(我实际上想使用ipython for 2.6.1,但它似乎不可用?)
I am using ipython on Mac OS 10.5 with python 2.5.1 (I would actually like to use ipython for 2.6.1, but it doesn't seem to be available?)
我通过easy_install安装了ipython。它工作但缺少gnu readline(用ctrl-R等搜索命令行历史记录所需)。
I installed ipython via easy_install. It works but is missing gnu readline (needed for nice searching of command line history with ctrl-R, etc.)
我发现博客文章和其他消息来源说这可以通过
I found a blog post and other sources saying this could be fixed by
sudo easy_install -f http://ipython.scipy.org/dist/ readline
然而,这导致 readline.c
中的构建错误,特别是未声明的函数,如 rl_compentry_func_t
和 rl_catch_signals
。
However, this leads to build errors in readline.c
, particularly undeclared functions like rl_compentry_func_t
and rl_catch_signals
.
有没有人看到这些错误?是否有其他方法可以使用readline安装ipython?
Has anyone seen these errors? Is there another way to get ipython installed with readline?
推荐答案
您可以使用MacPorts基本上使用一个命令安装所需的一切。首先从 http://www.macports.org/ 下载并安装MacPorts。
You can install everything you need with essentially one command using MacPorts. First download and install MacPorts from http://www.macports.org/.
然后在终端中执行以下操作:
1)sudo port -v selfupdate
2)sudo port -v install py26 -ipython
Then just do the following in the terminal:
1) sudo port -v selfupdate
2) sudo port -v install py26-ipython
这将为您安装python2.6,ipython for python 2.6和readline。启动ipython的命令位于/opt/local/bin/ipython2.6
That will install python2.6, ipython for python 2.6 and readline for you. The command to start ipython will be located at /opt/local/bin/ipython2.6
这篇关于在mac上安装带有readline的ipython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!