You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x ] I am using the current master branch or the latest release. Please indicate.
[x ] I am running on an up-to-date pypsa-eur environment. Update via conda env update -f envs/environment.yaml.
Describe the Bug
When trying to run prepare_sector_network.py as standalone script (while trying do debug some other issue), I get
ImportError: cannot import name 'Dict' from 'pypsa.descriptors' (/home/projekt-resilient03/conda/envs/pypsa-eur/lib/python3.12/site-packages/pypsa/descriptors.py)
a) Please update pypsa-eur to be compatible to the latest version of pypsa.
b) Please adapt tutorial documentation to use environment.fixed.yml instead of environment.yml (or
update version ranges of environment.yml to ensure that all code can be run without version issues).
c) Please implement some automated quality check pipeline/GitHub workflow to fail fast, if such version conflicts should occur in the future again. The quality assurance workflow should inform developers via email, if their changes are causing any issue for the resources needed by the beginner tutorials.
For what it's worth, I was able to resolve this error while working in table_pypsa by switching a reference to pypsa.descriptors.Dict to pypsa.descriptors.OrderedDict, which I tried based on console inspection.
Maybe this could help with this particular error? It seemed to be sufficient here.
However I agree troubleshooting through a stack of changing packages has been a hurdle, but I am too much of a novice to know whether this is an "easy" fix.
Thanks @fhg-isi and @jotisl!
You are both very right. The issue was fixed in #1340, and #1389 introduces an up-to-date pinned environment where these things should no longer happen.
There are also plans to add a check to see if your local env matches the current pinned one (optional), which should fix all sorts of dependency issues once and for all.
Checklist
master
branch or the latest release. Please indicate.pypsa-eur
environment. Update viaconda env update -f envs/environment.yaml
.Describe the Bug
When trying to run prepare_sector_network.py as standalone script (while trying do debug some other issue), I get
ImportError: cannot import name 'Dict' from 'pypsa.descriptors' (/home/projekt-resilient03/conda/envs/pypsa-eur/lib/python3.12/site-packages/pypsa/descriptors.py)
The file
https://github.com/PyPSA/PyPSA/blob/master/pypsa/descriptors.py
does not contain a class "Dict" in its current version.
=>
a) Please update pypsa-eur to be compatible to the latest version of pypsa.
b) Please adapt tutorial documentation to use environment.fixed.yml instead of environment.yml (or
update version ranges of environment.yml to ensure that all code can be run without version issues).
c) Please implement some automated quality check pipeline/GitHub workflow to fail fast, if such version conflicts should occur in the future again. The quality assurance workflow should inform developers via email, if their changes are causing any issue for the resources needed by the beginner tutorials.
Related:
#1347
#1118
The text was updated successfully, but these errors were encountered: