gpt4 book ai didi

python - 将 ipython 设置为 pydev 的解释器

转载 作者:太空狗 更新时间:2023-10-30 00:41:36 26 4
gpt4 key购买 nike

我想在 Pydev eclipse 插件中使用 IPython 作为解释器。

我有 IPython 0.10 和 Pydev 2.5.0,在 linux (opensuse) 上运行。

当我进入 Pydev 首选项并尝试设置 IPython 路径(如本页所述:http://pydev.org/manual_101_interpreter.html)时,出现以下错误

“找不到 Python stdlib 或在没有 .py 文件的情况下找到 stdlib”

ipython 解释器在 bash 终端上工作正常,我从命令“which ipython”获得路径。

有人可以帮助我吗?

谢谢!

interpreterInfo.py 输出是:

python /home/softs/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py 


<xml>
<version>2.7</version>
<executable>/usr/bin/python</executable>
<lib path="out">/home/softs/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc</lib>
<lib path="ins">/usr/local/lib64/python2.7/site-packages/scikits.timeseries-0.91.3-py2.7-linux-x86_64.egg</lib>
<lib path="ins">/usr/local/lib64/python2.7/site-packages/distribute-0.6.19-py2.7.egg</lib>
<lib path="ins">/usr/local/lib64/python2.7/site-packages/MeshPy-2011.1-py2.7-linux-x86_64.egg</lib>
<lib path="out">/data/dvp/python</lib>
<lib path="out">/home/mayet</lib>
<lib path="ins">/usr/lib/python27.zip</lib>
<lib path="ins">/usr/lib64/python2.7</lib>
<lib path="ins">/usr/lib64/python2.7/plat-linux2</lib>
<lib path="ins">/usr/lib64/python2.7/lib-tk</lib>
<lib path="ins">/usr/lib64/python2.7/lib-old</lib>
<lib path="ins">/usr/lib64/python2.7/lib-dynload</lib>
<lib path="ins">/usr/lib64/python2.7/site-packages</lib>
<lib path="ins">/usr/lib64/python2.7/site-packages/PIL</lib>
<lib path="ins">/usr/local/lib64/python2.7/site-packages</lib>
<lib path="ins">/usr/local/lib/python2.7/site-packages</lib>
<lib path="ins">/usr/lib64/python2.7/site-packages/gtk-2.0</lib>
<lib path="ins">/usr/lib/python2.7/site-packages</lib>
<lib path="ins">/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info</lib>
<lib path="ins">/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode</lib>
<forced_lib>__builtin__</forced_lib>
<forced_lib>__main__</forced_lib>
<forced_lib>_ast</forced_lib>
<forced_lib>_codecs</forced_lib>
<forced_lib>_sre</forced_lib>
<forced_lib>_symtable</forced_lib>
<forced_lib>_warnings</forced_lib>
<forced_lib>errno</forced_lib>
<forced_lib>exceptions</forced_lib>
<forced_lib>gc</forced_lib>
<forced_lib>imp</forced_lib>
<forced_lib>marshal</forced_lib>
<forced_lib>posix</forced_lib>
<forced_lib>pwd</forced_lib>
<forced_lib>signal</forced_lib>
<forced_lib>sys</forced_lib>
<forced_lib>thread</forced_lib>
<forced_lib>xxsubtype</forced_lib>
<forced_lib>zipimport</forced_lib>
</xml>Traceback (most recent call last):
File "/home/softs/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 142, in <module>
raise RuntimeError('Ok, this is so that it shows the output (ugly hack for some platforms, so that it releases the output).')
RuntimeError: Ok, this is so that it shows the output (ugly hack for some platforms, so that it releases the output).

最佳答案

这意味着在这些路径(xml 标记)中,PyDev 都无法找到 Python 库文件(例如 threading.py 或 traceback.py 等——请注意,如果您只有 .pyc 文件,则可能会发生这种情况也不是这些文件夹之一中的实际 .py 文件)。

或者您没有保留包含在解释器配置过程中选择的 Python 库的文件夹。

请注意,您并没有真正将“IPython”设置为解释器,而是将 Python 本身设置为解释器,并且可以安装 IPython 库以在交互式控制台中使用:http://pydev.org/manual_adv_interactive_console.html (但从你的输出来看,你似乎在指向 configure/usr/bin/python 时做对了)。

关于python - 将 ipython 设置为 pydev 的解释器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10232746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com