Hello everyone,
I don't think that Ammar need this suggestions anymore, but I managed to run PyPSA-Eur-Sec on Windows with the following Changes:
1) Windows and Linux use different delimiters by calling a path. When running pypsa-eur, Windows helps with this issue and "corrects" the Path by itself.
In the Snakemake Subworkflow from PyPSa-Eur-Sec to PyPSA-Eur, Snakemake searches for the path with "/", but Windows uses "\".
So every Snakerule from PyPSA-Eur, which is called from PyPSA-Eur-Sec Snakefile with the keyword "pypsaeur" must be changed from the delimiter "/" to "\" with a "r" infront of the quotation marks
for raw string. Furthermore the modified path from this rules must be changed in every Rule, where the Output from the modified path is an Input.
For example: In the PyPSA-Eur-Sec-Snakefile rule "build_populations_layouts" the nuts3-shapes is an input from PyPSA-Eur with "nuts_shapes=pypsaeur('resources/nuts3_shapes.geojson'),"
so we change within the PyPSA-Eur Snakefile the Rule "build_shapes" in the Output Section from "nuts3_shapes='resources/nuts3_shapes.geojson' " to "nuts3_shapes= r'resources\nuts3_shapes.geojson' " .
The nuts3_shapes is an input in the PyPSA-Eur Rule "add_electricity", so the path must be changed there the same way.
2) The Yaml File gets decoded with the default decodation of the OS. Our Yaml File is written in utf-8, which can cause an error on Windows
machines. But with an small modification of an py-script of Snakemake , this can be solved.
In the py-script "io.py" from the snakemake package in the definition of the method "_load_configfile..." the line
"with open(configpath) as f: " must be changed to "with open(configpath, encoding ="utf-8") as f:"
With this to Changes, I managed to run PyPSA-Eur Sec (Commit 5a7f0c2 and PyPSA-Eur Commit 08674a6).
I'm very sorry, if this post is hard to read, but I wanted to offer some help, if someone else is trying to run PyPSA-Eur-Sec on a Windows Machine.
Best Regards,
Erik