2012-04-20 65 views
2

我已經在eclipse中安裝了PyDev和Jython,並且我從來沒有遇到過問題。然而,這一次,我得到一個錯誤與手動或自動安裝:爲PyDev安裝Jython時出錯

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:>>Traceback (innermost last): 
    File "/home/michaele/Downloads/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 89, in ? 
    File "/home/michaele/Downloads/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 46, in nativePath 
    File "/home/michaele/Downloads/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 51, in fullyNormalizePath 
AttributeError: class 'org.python.modules.os' has no attribute 'path' 
<< 

運行,與在命令行上的Jython或Python相同的腳本似乎罰款:

$ python /eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py 
<xml> 
<version>2.6</version> 
<executable>/usr/bin/python</executable> 
<lib path="out">/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc</lib> 
<lib path="ins">/usr/lib/python2.6</lib> 
<lib path="ins">/usr/lib/python2.6/plat-linux2</lib> 
<lib path="ins">/usr/lib/python2.6/lib-tk</lib> 
<lib path="ins">/usr/lib/python2.6/lib-old</lib> 
<lib path="ins">/usr/lib/python2.6/lib-dynload</lib> 
<lib path="ins">/usr/local/lib/python2.6/dist-packages</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/PIL</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/gst-0.10</lib> 
<lib path="ins">/usr/lib/pymodules/python2.6</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/gtk-2.0</lib> 
<lib path="ins">/usr/lib/pymodules/python2.6/gtk-2.0</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>_collections</forced_lib> 
<forced_lib>_functools</forced_lib> 
<forced_lib>_hashlib</forced_lib> 
<forced_lib>_locale</forced_lib> 
<forced_lib>_random</forced_lib> 
<forced_lib>_socket</forced_lib> 
<forced_lib>_sre</forced_lib> 
<forced_lib>_ssl</forced_lib> 
<forced_lib>_struct</forced_lib> 
<forced_lib>_symtable</forced_lib> 
<forced_lib>_warnings</forced_lib> 
<forced_lib>_weakref</forced_lib> 
<forced_lib>array</forced_lib> 
<forced_lib>binascii</forced_lib> 
<forced_lib>cPickle</forced_lib> 
<forced_lib>cStringIO</forced_lib> 
<forced_lib>errno</forced_lib> 
<forced_lib>exceptions</forced_lib> 
<forced_lib>fcntl</forced_lib> 
<forced_lib>gc</forced_lib> 
<forced_lib>grp</forced_lib> 
<forced_lib>imp</forced_lib> 
<forced_lib>itertools</forced_lib> 
<forced_lib>marshal</forced_lib> 
<forced_lib>math</forced_lib> 
<forced_lib>operator</forced_lib> 
<forced_lib>posix</forced_lib> 
<forced_lib>pwd</forced_lib> 
<forced_lib>select</forced_lib> 
<forced_lib>signal</forced_lib> 
<forced_lib>spwd</forced_lib> 
<forced_lib>strop</forced_lib> 
<forced_lib>sys</forced_lib> 
<forced_lib>syslog</forced_lib> 
<forced_lib>thread</forced_lib> 
<forced_lib>time</forced_lib> 
<forced_lib>unicodedata</forced_lib> 
<forced_lib>xxsubtype</forced_lib> 
<forced_lib>zipimport</forced_lib> 
<forced_lib>zlib</forced_lib> 
</xml>Traceback (most recent call last): 
    File "/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). 
$ jython /eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py 
<xml> 
<version>2.2</version> 
<executable>None</executable> 
<lib path="out">/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc</lib> 
<lib path="ins">/usr/share/jython/Lib</lib> 
<lib path="out">/usr/lib/site-python</lib> 
<lib path="out">__classpath__</lib> 
<forced_lib>sets</forced_lib> 
<forced_lib>cPickle</forced_lib> 
<forced_lib>math</forced_lib> 
<forced_lib>thread</forced_lib> 
<forced_lib>md5</forced_lib> 
<forced_lib>_jython</forced_lib> 
<forced_lib>py_compile</forced_lib> 
<forced_lib>time</forced_lib> 
<forced_lib>jarray</forced_lib> 
<forced_lib>array</forced_lib> 
<forced_lib>os</forced_lib> 
<forced_lib>xreadlines</forced_lib> 
<forced_lib>operator</forced_lib> 
<forced_lib>binascii</forced_lib> 
<forced_lib>_sre</forced_lib> 
<forced_lib>errno</forced_lib> 
<forced_lib>synchronize</forced_lib> 
<forced_lib>types</forced_lib> 
<forced_lib>ucnhash</forced_lib> 
<forced_lib>pre</forced_lib> 
<forced_lib>struct</forced_lib> 
<forced_lib>_weakref</forced_lib> 
<forced_lib>new</forced_lib> 
<forced_lib>imp</forced_lib> 
<forced_lib>exceptions</forced_lib> 
<forced_lib>cStringIO</forced_lib> 
<forced_lib>sha</forced_lib> 
<forced_lib>_codecs</forced_lib> 
</xml>Traceback (innermost last): 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 142, in ? 
RuntimeError: Ok, this is so that it shows the output (ugly hack for some platforms, so that it releases the output). 

也從交互式控制檯運行與Python或Jython的日食工作即:

的Python:

import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) 
/usr/bin/python2.6 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) 
[GCC 4.4.5] 
PyDev console: using default backend (IPython not available). 
import os 
os.path.normpath('/') 
'/' 

的Jython:

import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) 
---> reloading /eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/pydevconsole.py 
PyDev console: using default backend (IPython not available). 

You are now in a console within Eclipse. 
Use it with care as it can halt the VM. 
Typing a line with "PYDEV_CONSOLE_TOGGLE_RUN_IN_UI" 
will start executing all the commands in the UI thread. 

java1.6.0_21 2.2.1 
import os 
os.path.normpath('/') 
'/' 

環境信息:

OS- Ubuntu 10.10 Maverick 

Eclipse- Version: Indigo Service Release 2 
     Build id: 20120216-1857 

Python- 2.6.6 

Jython- 2.2.1 on java1.6.0_21 

Java- java version "1.6.0_21" 
     Java(TM) SE Runtime Environment (build 1.6.0_21-b06) 
     Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode) 

對不起,長職位,但我不知道什麼是相關的。我嘗試了所有我能想到的方式來讓Jython在PyDev中工作無濟於事。任何幫助將不勝感激。

感謝,

邁克

EDIT1:添加到法比奧響應

感謝所有的建議,我apprecaite幫助。但是還是不行。

  1. 導致此類錯誤:

無法收集從系統所需要的信息。

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:>>Traceback (innermost last): 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 15, in ? 
ImportError: no module named javaos 
<< 

這對我來說沒什麼意義。

  1. 作出了同樣的錯誤,我已經越來越:

無法收集從系統所需要的信息。

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:>>Traceback (innermost last): 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 89, in ? 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 46, in nativePath 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 51, in fullyNormalizePath 
AttributeError: class 'org.python.modules.os' has no attribute 'path' 
<< 
  1. 從日食:

    無法收集從系統所需要的信息。

    這通常意味着您的解釋器不在 的系統PATH中。 嘗試創建解釋器信息時,沒有輸出出現在標準輸出中。 錯誤輸出包含:>> Traceback(最裏面的最後一個): (無代碼對象)在第0行 文件「/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py」,第17行('\ n'.join(sorted(str(x)for x in os.environ。項目()))) ^ 語法錯誤:無效的語法 < <

從控制檯:

python /eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py 
('COLORTERM', 'gnome-terminal') 
('DBUS_SESSION_BUS_ADDRESS', 'unix:abstract=/tmp/dbus-sgAQf9jF15,guid=95ee83c3b3510c530cb4ea8500000066') 
('DEFAULTS_PATH', '/usr/share/gconf/gnome.default.path') 
('DESKTOP_SESSION', 'gnome') 
('DISPLAY', ':0.0') 
('GDMSESSION', 'gnome') 
('GDM_KEYBOARD_LAYOUT', 'us') 
('GDM_LANG', 'en_US.utf8') 
('GNOME_DESKTOP_SESSION_ID', 'this-is-deprecated') 
('GNOME_KEYRING_CONTROL', '/tmp/keyring-JsqHSQ') 
('GNOME_KEYRING_PID', '1799') 
('GTK_MODULES', 'canberra-gtk-module') 
('HOME', '/home/michaele') 
('LANG', 'en_US.utf8') 
('LOGNAME', 'michaele') 
('MANDATORY_PATH', '/usr/share/gconf/gnome.mandatory.path') 
('ORBIT_SOCKETDIR', '/tmp/orbit-michaele') 
('PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games') 
('PWD', '/home/michaele') 
('SESSION_MANAGER', 'local/michaele-Dell-System-XPS-L702X:@/tmp/.ICE-unix/1818,unix/michaele-Dell-System-XPS-L702X:/tmp/.ICE-unix/1818') 
('SHELL', '/bin/bash') 
('SHLVL', '1') 
('SSH_AGENT_PID', '1848') 
('SSH_AUTH_SOCK', '/tmp/keyring-JsqHSQ/ssh') 
('TERM', 'xterm') 
('USER', 'michaele') 
('USERNAME', 'michaele') 
('WINDOWID', '67108892') 
('WINDOWPATH', '7') 
('XAUTHORITY', '/var/run/gdm/auth-for-michaele-cd81Hc/database') 
('XDG_CONFIG_DIRS', '/etc/xdg/xdg-gnome:/etc/xdg') 
('XDG_DATA_DIRS', '/usr/share/gnome:/usr/local/share/:/usr/share/') 
('XDG_SESSION_COOKIE', '6b516b0ac1421896dc0de6dc00000009-1335548722.708677-1288196033') 
('_', '/usr/bin/python') 
<xml> 
<version>2.6</version> 
<executable>/usr/bin/python</executable> 
<lib path="out">/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc</lib> 
<lib path="ins">/usr/lib/python2.6</lib> 
<lib path="ins">/usr/lib/python2.6/plat-linux2</lib> 
<lib path="ins">/usr/lib/python2.6/lib-tk</lib> 
<lib path="ins">/usr/lib/python2.6/lib-old</lib> 
<lib path="ins">/usr/lib/python2.6/lib-dynload</lib> 
<lib path="ins">/usr/local/lib/python2.6/dist-packages</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/PIL</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/gst-0.10</lib> 
<lib path="ins">/usr/lib/pymodules/python2.6</lib> 
<lib path="ins">/usr/lib/python2.6/dist-packages/gtk-2.0</lib> 
<lib path="ins">/usr/lib/pymodules/python2.6/gtk-2.0</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>_collections</forced_lib> 
<forced_lib>_functools</forced_lib> 
<forced_lib>_hashlib</forced_lib> 
<forced_lib>_locale</forced_lib> 
<forced_lib>_random</forced_lib> 
<forced_lib>_socket</forced_lib> 
<forced_lib>_sre</forced_lib> 
<forced_lib>_ssl</forced_lib> 
<forced_lib>_struct</forced_lib> 
<forced_lib>_symtable</forced_lib> 
<forced_lib>_warnings</forced_lib> 
<forced_lib>_weakref</forced_lib> 
<forced_lib>array</forced_lib> 
<forced_lib>binascii</forced_lib> 
<forced_lib>cPickle</forced_lib> 
<forced_lib>cStringIO</forced_lib> 
<forced_lib>errno</forced_lib> 
<forced_lib>exceptions</forced_lib> 
<forced_lib>fcntl</forced_lib> 
<forced_lib>gc</forced_lib> 
<forced_lib>grp</forced_lib> 
<forced_lib>imp</forced_lib> 
<forced_lib>itertools</forced_lib> 
<forced_lib>marshal</forced_lib> 
<forced_lib>math</forced_lib> 
<forced_lib>operator</forced_lib> 
<forced_lib>posix</forced_lib> 
<forced_lib>pwd</forced_lib> 
<forced_lib>select</forced_lib> 
<forced_lib>signal</forced_lib> 
<forced_lib>spwd</forced_lib> 
<forced_lib>strop</forced_lib> 
<forced_lib>sys</forced_lib> 
<forced_lib>syslog</forced_lib> 
<forced_lib>thread</forced_lib> 
<forced_lib>time</forced_lib> 
<forced_lib>unicodedata</forced_lib> 
<forced_lib>xxsubtype</forced_lib> 
<forced_lib>zipimport</forced_lib> 
<forced_lib>zlib</forced_lib> 
</xml>Traceback (most recent call last): 
    File "/eclipse/plugins/org.python.pydev_2.5.0.2012040618/PySrc/interpreterInfo.py", line 143, 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). 

回答

0

必須說,我從來沒有見過一個前:)

有些事情我可想而知可以解決它:

  1. 嘗試改變:

    \插件\ org.python.pydev_2.5.0.2012040618 \ PySrc \ interpreterInfo.py

    變化:

    進口OS

    到:

    進口os.path

  2. 另一個猜測是Eclipse內部的一些環境變量是不同的。首先要檢查的是從你打印的相同控制檯啓動Eclipse(而不是直接從桌面啓動 - 如果是這種情況)。

  3. 如果仍然不能正常工作,請執行以下操作:

    在interpreterInfo.py腳本的開始( 「導入OS」 後)

    做:

    打印( '\ n'.join(在os.environ.items()中對x進行排序(str(x))))

    然後嘗試配置解釋器並在帖子中發佈該日誌。然後,從控制檯運行interpreterInfo.py並將其添加到帖子中(以查看環境是否有任何不同)。

+0

感謝您的建議,我已經更新了與您要求的信息,但仍然沒有去。 – mikee805 2012-04-27 18:07:41

+0

那麼,真正的問題似乎是,從Eclipse內部運行時,jython無法找到javay.py文件(實際上映射到os.path),這應該在Jython庫中提供...一個簡單的目前的解決方法可能是編輯interpreterInfo.py,以便fullyNormalizePath(路徑)僅執行「返回路徑」(而不是使用os.path.normpath)。 – 2012-04-29 00:47:44

+0

謝謝,似乎讓我過去的安裝。現在到新的更令人興奮的錯誤! – mikee805 2012-05-05 23:35:02

1

我遇到了一個有點類似的問題,嘗試添加Jython解釋日食時,得到消息的「從翻譯錯誤獲取信息」。就我而言,我使用的是我自己構建的Jython版本。

當您在根jython目錄中運行ant build(無選項)時,它將生成dist/jython-dev.jar。這個jar文件如果不同於你從jython網站下載的jar文件,它不捆綁jython需要的所有第三方jar。儘管ant生成的dist/bin/jython腳本將這些腳本添加到類路徑中。

Pydev雖然不使用該腳本來運行Jython,但它只是使用jar文件並假定它包含所需的所有內容。爲了得到Pydev的運行這樣的命令解釋器信息:

/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java -Dpython.home=/Users/me/dev/projects/jython/dist -classpath /Users/me/dev/projects/jython/dist/jython-dev.jar org.python.util.jython /Users/me/dev/projects/Pydev/plugins/org.python.pydev/pysrc/interpreterInfo.py 

您可以編譯,通過在Jython的根文件夾捉迷藏以下捆綁所有要求的jython.jar文件:

ant jar-complete 

這將把jython。jar進入dist文件夾,這應該可以和Pydev一起工作。