【发布时间】:2011-11-14 14:08:07
【问题描述】:
当我在我的 osx 上安装 ipython 并运行它时,我收到以下警告:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
site-packages/IPython/utils/rlineimpl.py:96:
RuntimeWarning: Leopard libedit detected - readline will not be wel
behaved including some crashes on tab completion, and incorrect
history navigation. It is highly recommended that you install
readline, which is easy_installable with: 'easy_install readline'
我已经安装了readline,不要使用原来安装在/Library/Frameworks/Python.framework/Versions/2.7/bin/python$的系统python。 /usr/bin/python 指向 2.7 版本,如下所示
uname -a
Darwin macbook.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7
16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
$sudo pip install readline ipython
$ipython --version
0.11
$/usr/bin/python --version #
Python 2.7.1
$which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
我已阅读 Python sys.path modification not working 中的问题 - 我将 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline-6.2.1-py2.7.egg-info 添加到 /Library/Frameworks/Python.framework/Versions/2.7/bin/ipython 中,现在它看起来像这样:http://pastebin.com/raw.php?i=dVnxufbS
但我无法弄清楚为什么会出现以下错误:
File
"/Library/Frameworks/Python.framework/Versions/2.7/bin/ipython",
line 9
sys.path.insert(0,"/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/site-packages/readline-6.2.1-py2.7.egg-info")
我不认为上述路径是一个问题,我的目标是让 ipython 正常工作而不会抱怨 readline,即使它已正确安装和导入。
【问题讨论】:
-
尽管有警告消息,但当我进入 ipython 时,选项卡完成确实有效。所以也许这意味着我可以忽略警告?
-
在看了这个之后,我发现了一个帖子bradmontgomery.net/blog/fix-leopard-libedit-detected,它解决了我的问题。我不得不运行“easy_install -a readline”,这使得 python 读取了最新安装的readline 这解决了这个问题。更多细节在这里:groups.google.com/forum/#!topic/python-virtualenv/BEQAurh9EZw/…。我不知道如何结束这个问题,因为我找到了自己的答案。
标签: python