问题
I am trying to embed Jython in Java because I need to be able to reuse some python code that is parsing a yaml. When I try to run the code below:
interp.exec("import sys");
interp.exec("print sys.version");
interp.exec("sys.path.append(\'C:/MyScripts\')");
interp.exec("import MyYAMLReader");
I get an error:
ImportError: No module named yaml
How can I resolve this? I am currently coding in Eclipse and have the jython2.7 jar. Is there anything else I need to be able to run this?
来源:https://stackoverflow.com/questions/30339439/jython-embedded-in-java-importerror-no-module-named-yaml