Closed dilull0 closed 1 year ago
I fixed the error in line 57 of https://github.com/GreenDelta/olca-ipc.py/blob/master/scripts/example.py and now import olca is causing an error.
Again, olca-ipc does not run in Jython. You have to use standard Python for this.
I was just about to delete this question as I figured it out.
Is the instructions for the ide setup only so that you can write code in eclipse, but then copy it into the Tools>Developer Tools>Python window? https://github.com/GreenDelta/openlca-python-tutorial/blob/master/ide_setup.md
Same here. I used Python 3.7 Programm code: import olca print("Hello World")
This ist the erro msg: by running -> python3 /java_test/python/import_olca_short.py
Traceback (most recent call last):
File "/java_test/python/import_olca_short.py", line 1, in
solved it by using the latest versiong from github.
This is driving me crazy and I do not know what I am doing wrong.
If I copy the code from https://github.com/GreenDelta/olca-ipc.py/blob/master/scripts/example.py in eclipse import olca works.
while olca import works I still get the following error message: File "C:\Users******\openLCA\jython_ide\workspace\Test\Test3.py", line 57 def create_flow(client: olca.Client, name: str, ^ SyntaxError: mismatched input ':' expecting
RPAREN
If I use the code from https://github.com/GreenDelta/olca-ipc.py then import olca does not work
import olca import uuid
client = olca.Client(8080) mass = client.find(olca.FlowProperty, 'Mass') steel = olca.Flow() steel.id = str(uuid.uuid4()) steel.flow_type = olca.FlowType.PRODUCT_FLOW steel.name = "Steel" steel.description = "Added from the olca-ipc python API..."
mass_factor = olca.FlowPropertyFactor() mass_factor.conversion_factor = 1.0 mass_factor.flow_property = mass mass_factor.reference_flow_property = True steel.flow_properties = [mass_factor]
client.insert(steel)
I get the following error: Traceback (most recent call last): File "C:\Users\gdilullo\openLCA\jython_ide\workspace\Test\Test4.py", line 6, in
import olca
ImportError: No module named olca
This posted is related to my earlier question https://github.com/GreenDelta/openlca-python-tutorial/issues/31