Jython 2.5.1: “ImportError: No Module named os”

我们两清 提交于 2019-12-05 03:34:05

What do you mean with "the jar that comes with the 2.5 download"? Did you extract the contents and use jython.jar or did you run the installer? If you just extracted and didn't run the installer your jython.jar will miss the whole LIB folder.

Can you check if jython.jar contains a LIB folder? (e.g. open jython.jar with 7z or WinZip).

Or try copying the LIB folder in the same folder where jython.jar resides.


Did you try setting these properties. Jython Registry. e.g. via -Dpython.home in the eclipse run configuration.

python.cachedir
python.path
python.home

How is the jar named? If similar to jython-complete.jar try renaming it to jython.jar

Something is wrong at a very deep level, but it's probably easy to fix. You are seeing an error that happens while trying to report some other error.

Probably you have your PYTHONPATH misconfigured. I don't know the details of Jython or Eclipse running Jython, but it looks like you have no standard library available to you.

If you are getting maven, using the dependency jython-standalone instead of jython may help (at least it did for me in a maven project with jython-standalone-2.5.3)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!