Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Eclipse插件+;Jython-未处理的事件循环异常_Python_Eclipse_Eclipse Plugin_Jython - Fatal编程技术网

Python Eclipse插件+;Jython-未处理的事件循环异常

Python Eclipse插件+;Jython-未处理的事件循环异常,python,eclipse,eclipse-plugin,jython,Python,Eclipse,Eclipse Plugin,Jython,以防其他人试图在自建eclipse插件中使用Jython。我遭受了2天的以下错误,这是在我试图通过解释器.exec(“从myScript导入*\n”)导入python脚本时发生的: !条目org.eclipse.ui 4 0 2015-12-11 11:22:53.549 !消息未处理的事件循环异常 !堆栈0 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 文件“/opt/eclipse/luna/../../../common/home/bel/schwinn/lnx/workspace

以防其他人试图在自建eclipse插件中使用Jython。我遭受了2天的以下错误,这是在我试图通过
解释器.exec(“从myScript导入*\n”)导入python脚本时发生的

!条目org.eclipse.ui 4 0 2015-12-11 11:22:53.549
!消息未处理的事件循环异常
!堆栈0
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/opt/eclipse/luna/../../../common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/src/scripts/iecommon.py”,第6行,在
从xml.dom导入minidom
文件“/common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/jython-standalone-2.7.0.jar/lib/xml/dom/____;u.py”,中第226行
文件“/common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/jython-standalone-2.7.0.jar/lib/xml/dom/MessageSource.py”,第19行,在
文件“/common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/jython-standalone-2.7.0.jar/lib/xml/FtCore.py”,第38行,在
文件“/common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/jython-standalone-2.7.0.jar/lib/xml/FtCore.py”,第38行,在
文件“/common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/jython-standalone-2.7.0.jar/lib/gettext.py”,第58行,在
文件“/opt/eclipse/luna/./../../common/home/bel/schwinn/lnx/workspace-silecs/silecs-configuration/target/lib/lib/jython-standalone-2.7.0.jar/lib/posixpath.py”,第77行,在join中
AttributeError:“非类型”对象没有属性“endswith”

需要将属性
python.home
设置为某个值。看起来哪一个值都无关紧要。。让它空着是不好的。 设置属性,例如,可以在java代码中完成:

    String jythonJarPath = "target/lib/jython-standalone-2.7.0.jar";
    String pythonLibPath = SilecsUtils.findInBundle(jythonJarPath);
    Properties sysProps = System.getProperties();
    sysProps.setProperty("python.path", pythonLibPath + "/Lib");
    sysProps.setProperty("python.home", ".");

需要将属性
python.home
设置为某个值。看起来哪一个值都无关紧要。。让它空着是不好的。 设置属性,例如,可以在java代码中完成:

    String jythonJarPath = "target/lib/jython-standalone-2.7.0.jar";
    String pythonLibPath = SilecsUtils.findInBundle(jythonJarPath);
    Properties sysProps = System.getProperties();
    sysProps.setProperty("python.path", pythonLibPath + "/Lib");
    sysProps.setProperty("python.home", ".");