0 votes
156 views
Hello,

I am using openLCA 2.2.0 on Apple Silicon (M1 Pro, MacOS 14.5) which I installed by the dmg-file from the website downloads.

I have manually installed Oracle java idk 22 in my system as well and did set the JAVA_HOME variable properly, too.

OpenLCA GUI is starting and running well, I also can use all GUI interfaces and work with it.

Now, I want to use the Python API scripting functions.

When I try out the 'say hello' example from https://github.com/GreenDelta/openlca-python-tutorial/ (directly copied into cache by the button on the website, no typo mistakes possible) inside of the running openLCA GUI,  I get this Error message in the Console:

14:16:44 ERROR org.openlca.app.util.ErrorReporter - failed execute script

org.python.core.PyException: ImportError: cannot import name Dialog

at org.python.core.Py.ImportError(Py.java:327)

at org.python.core.imp.importFromAs(imp.java:1648)

at org.python.core.imp.importFrom(imp.java:1611)

at org.python.pycode._pyx11.f$0(<string>:8)

at org.python.pycode._pyx11.call_function(<string>)

at org.python.core.PyTableCode.call(PyTableCode.java:173)

at org.python.core.PyCode.call(PyCode.java:18)

at org.python.core.Py.runCode(Py.java:1703)

at org.python.core.Py.exec(Py.java:1747)

at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:268)

at org.openlca.app.devtools.python.Jython.exec(Jython.java:49)

at org.openlca.app.devtools.python.PythonEditor.lambda$0(PythonEditor.java:47)

at org.openlca.app.WrappedJob.run(WrappedJob.java:30)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Any ideas what needs to be done?
in openLCA by (120 points)

1 Answer

0 votes
by (126k points)
The Python tutorial in your link is for openLCA version 1, the language in version 2 has changed somewhat; we plan to make a new documentation sometime, sorry for now!
...