eclipse 无法为 pydev 收集 Python 解释器信息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13039194/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:15:22  来源:igfitidea点击:

Unable to gather python interpreter info for pydev

eclipsepydev

提问by user1769577

OS: Windows 7 x64

操作系统:Windows 7 x64

Python: 2.7.3

蟒蛇:2.7.3

Pydev: 2.7.1.2012100913

Pydev:2.7.1.2012100913

Eclipse: Version: Juno Service Release 1 Build id: 20121004-1855

Eclipse:版本:Juno Service Release 1 构建 ID:20121004-1855

I am unable to configure a python interpreter in Pydev. If I try using the auto-configuration or the manual configuration I get the same type of error output:

我无法在 Pydev 中配置 python 解释器。如果我尝试使用自动配置或手动配置,我会得到相同类型的错误输出:

Unable to gather the needed info from the system.

This usually means that your interpreter is not in the system PATH. No output was in the standard output when trying to create the interpreter info. The error output contains:>><<

无法从系统收集所需的信息。

这通常意味着您的解释器不在系统 PATH 中。尝试创建解释器信息时,标准输出中没有输出。错误输出包含:>><<

or

或者

See error log for details. No output was in the standard output when trying to create the interpreter info. The error output contains:>><<

有关详细信息,请参阅错误日志。尝试创建解释器信息时,标准输出中没有输出。错误输出包含:>><<

Python is in my PATH. Here is the output of interpreterInfo.py(stdout and stderr):

Python 在我的路径中。这是interpreterInfo.py(stdout 和 stderr)的输出:

<xml>
<version>2.7</version>
<executable>C:\Python27\python.exe</executable>
<lib path="out">D:\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc</lib>
<lib path="ins">C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\logilab_common-0.58.0-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\logilab_astng-0.23.1-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\pip-1.1-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\pylint-0.25.1-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\rope-0.9.3-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\docutils-0.9.1-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\jinja2-2.6-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\pygments-1.5-py2.7.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\lxml-2.2.8-py2.7-win32.egg</lib>
<lib path="ins">C:\Python27\lib\site-packages\spyder-2.0.10-py2.7.egg</lib>
<lib path="out">C:\Windows\system32\python27.zip</lib>
<lib path="ins">C:\Python27\DLLs</lib>
<lib path="ins">C:\Python27\lib</lib>
<lib path="ins">C:\Python27\lib\plat-win</lib>
<lib path="ins">C:\Python27\lib\lib-tk</lib>
<lib path="ins">C:\Python27</lib>
<lib path="ins">C:\Python27\lib\site-packages</lib>
<lib path="ins">C:\Python27\lib\site-packages\PIL</lib>
<lib path="ins">C:\Python27\lib\site-packages\win32</lib>
<lib path="ins">C:\Python27\lib\site-packages\win32\lib</lib>
<lib path="ins">C:\Python27\lib\site-packages\Pythonwin</lib>
<lib path="ins">C:\Python27\lib\site-packages\wx-2.8-msw-ansi</lib>
<forced_lib>__builtin__</forced_lib>
<forced_lib>__main__</forced_lib>
<forced_lib>_ast</forced_lib>
<forced_lib>_bisect</forced_lib>
<forced_lib>_codecs</forced_lib>
<forced_lib>_codecs_cn</forced_lib>
<forced_lib>_codecs_hk</forced_lib>
<forced_lib>_codecs_iso2022</forced_lib>
<forced_lib>_codecs_jp</forced_lib>
<forced_lib>_codecs_kr</forced_lib>
<forced_lib>_codecs_tw</forced_lib>
<forced_lib>_collections</forced_lib>
<forced_lib>_csv</forced_lib>
<forced_lib>_functools</forced_lib>
<forced_lib>_heapq</forced_lib>
<forced_lib>_hotshot</forced_lib>
<forced_lib>_io</forced_lib>
<forced_lib>_json</forced_lib>
<forced_lib>_locale</forced_lib>
<forced_lib>_lsprof</forced_lib>
<forced_lib>_md5</forced_lib>
<forced_lib>_multibytecodec</forced_lib>
<forced_lib>_random</forced_lib>
<forced_lib>_sha</forced_lib>
<forced_lib>_sha256</forced_lib>
<forced_lib>_sha512</forced_lib>
<forced_lib>_sre</forced_lib>
<forced_lib>_struct</forced_lib>
<forced_lib>_subprocess</forced_lib>
<forced_lib>_symtable</forced_lib>
<forced_lib>_warnings</forced_lib>
<forced_lib>_weakref</forced_lib>
<forced_lib>_winreg</forced_lib>
<forced_lib>array</forced_lib>
<forced_lib>audioop</forced_lib>
<forced_lib>binascii</forced_lib>
<forced_lib>cPickle</forced_lib>
<forced_lib>cStringIO</forced_lib>
<forced_lib>cmath</forced_lib>
<forced_lib>datetime</forced_lib>
<forced_lib>errno</forced_lib>
<forced_lib>exceptions</forced_lib>
<forced_lib>future_builtins</forced_lib>
<forced_lib>gc</forced_lib>
<forced_lib>imageop</forced_lib>
<forced_lib>imp</forced_lib>
<forced_lib>itertools</forced_lib>
<forced_lib>marshal</forced_lib>
<forced_lib>math</forced_lib>
<forced_lib>mmap</forced_lib>
<forced_lib>msvcrt</forced_lib>
<forced_lib>nt</forced_lib>
<forced_lib>operator</forced_lib>
<forced_lib>parser</forced_lib>
<forced_lib>signal</forced_lib>
<forced_lib>strop</forced_lib>
<forced_lib>sys</forced_lib>
<forced_lib>thread</forced_lib>
<forced_lib>time</forced_lib>
<forced_lib>xxsubtype</forced_lib>
<forced_lib>zipimport</forced_lib>
<forced_lib>zlib</forced_lib>
</xml>Traceback (most recent call last):
  File "D:\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\interpreterInfo.py", line 199, 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).

Any help would be great, thanks!

任何帮助都会很棒,谢谢!

回答by vam97

I did not expect such a problem: (PyDev worked on 27 64-bit PCs under Indigo; I tested The Same PyDev plus Python under Juno on a 32-bit Pc with success; Then by the first attempt on a 64-bit PC came the error ... I have not used "autoconfig" at all. I was going the line "File>New>PyDevProject> ...PrjectName... click_here_to_configure_an_interpreter_not_listed" when it happened."

没想到会出现这样的问题:(PyDev 在 Indigo 下的 27 台 64 位 PC 上工作;我在 Juno 下在 32 位 PC 上测试了相同的 PyDev 加 Python 并成功;然后在 64 位 PC 上的第一次尝试出现了错误......我根本没有使用“自动配置”。当它发生时,我正在执行“文件>新建> PyDevProject> ...PrjectName ... click_here_to_configure_an_interpreter_not_listed”这一行。“

After short googleing the luck came:-)

短暂的谷歌搜索后,运气来了:-)

http://pydev.org/manual_101_interpreter.htmlhelped me to solve the problem , using just an alternative path to the same thing. {1. Go to: window > preferences > PyDev > Interpreter - (Python/Jython/IronPython). ...}

http://pydev.org/manual_101_interpreter.html帮助我解决了这个问题,只使用了同一件事的替代路径。{1. 转到:窗口 > 首选项 > PyDev > 解释器 - (Python/Jython/IronPython)。...}

回答by user2686464

I had a similar issue. I could not manually or automatically configure. I worked around the problem by re-installing python 2.7. After re-install auto-configuration worked.

我有一个类似的问题。我无法手动或自动配置。我通过重新安装 python 2.7 解决了这个问题。重新安装后自动配置工作。

回答by Carrey

I am running Python 3, so I had to make these changes to get python.exe as my interpreter. File:

我正在运行 Python 3,因此我必须进行这些更改才能将 python.exe 作为我的解释器。文件:

C:\EasyEclipse-for-LAMP-1.2.2.2\extensions \pydev-1.3.3\eclipse\plugins \org.python.pydev_1.3.3\PySrc \interpreterInfo.py

C:\EasyEclipse-for-LAMP-1.2.2.2\extensions\pydev-1.3.3\eclipse\plugins\org.python.pydev_1.3.3\PySrc\interpreterInfo.py

Edit all occurrences of “print …” to “

将所有出现的“ print …”编辑为“

print(…)

” (the … is whatever is being printed), so wrap it in quotes.

”(... 是正在打印的任何内容),因此将其用引号括起来。

Comment out line 16, since Trueand Falseare considered keywords in Python 3. Save, and you should be able to successfully set C:\Python32\python.exeas the interpreter. I kept the default folders checked.

注释掉第 16 行,因为TrueFalse在 Python 3 中被认为是关键字。保存,您应该能够成功设置C:\Python32\python.exe为解释器。我保持选中默认文件夹。

回答by cboittin

I encountered this problem on Windows after directly copying my python 2.7 (64bits) directory to a new computer. Neither automatic not manual configuration would work, and I had the same errors as you did.

直接将我的python 2.7(64位)目录复制到新计算机后,我在Windows上遇到了这个问题。无论是自动配置还是手动配置都不起作用,而且我遇到了与您相同的错误。

I came back to the original installation, went to C:\Windows\System32 (you might also check SysWOW64, but I'm not sure Python even uses it) and fetched :

我回到原始安装,转到 C:\Windows\System32(您可能还会检查 SysWOW64,但我不确定 Python 甚至使用它)并获取:

  • python27.dll
  • pythoncom27.dll
  • pythoncomloader27.dll
  • pywintypes27.dll
  • python27.dll
  • pythoncom27.dll
  • pythoncomloader27.dll
  • pywintypes27.dll

I copied them into the new computer's System32 and pydev's autoconfig was able to find my python interpreter from the environment variables.

我将它们复制到新计算机的 System32 中,pydev 的 autoconfig 能够从环境变量中找到我的 python 解释器。

回答by Selvaji

Please Make sure you have installed proper version [32 or 64 bit] of python corresponding to your system OS version

请确保您已经安装了与您的系统操作系统版本相对应的正确版本的python [32 或 64 位]

回答by GLampros

I have a similar issue. Try to run "python --version" to see that python executes in your system

我有一个类似的问题。尝试运行“python --version”以查看python在您的系统中执行