Hello,
I am trying to automatically extract the contribution tree results into excel files. For this reason, I installed the olca-ipc package using pip install -U olca-ipc in my virtual environment running Python 3.12.2. I get a ModuleNotFoundError: No module named 'olca' when trying to import the olca module from olca-ipc via import olca into my jupyter notebook.
I've tried uninstalling and reinstalling olca-ipc. I have tried clearing the cache before reinstalling. I have also created a kernel from my environment using:
python -m ipykernel install --user --name=myenv --display-name="Python (myenv)"
and connected this kernel to my notebook. I still can't import the module and would be grateful for any ideas.
edit:
import olca_ipc
import olca_schema as o
from olca_schema import CalculationType
client = olca_ipc.Client(8080)
product_system = client.get(o.ProductSystem, product_system_id)
impact_method = client.get(o.ImpactMethod, impact_method_id)
setup = o.CalculationSetup(
target=o.Ref(o.RefType.ProductSystem, product_system_id),
impact_method=o.Ref(o.RefType.ImpactMethod, impact_method_id),
calculation_type=o.CalculationType.CONTRIBUTION_ANALYSIS
)