I am trying to learn to use Pypsa, but i am getting an error in the base_network rule
It happens with the tutorial.
Conda is updated and the pypsa environment to.
Ant help is much appreciated.
(pypsa-eur) C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur>snakemake -j 1 results/networks/elec_s_6_ec_lcopt_Co2L-24H.nc
Set parameter Username
Academic license - for non-commercial use only - expires 2022-03-27
No parameters matching '_test' found
Building DAG of jobs...
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job count min threads max threads
------------------------ ------- ------------- -------------
add_electricity 1 1 1
add_extra_components 1 1 1
base_network 1 1 1
build_bus_regions 1 1 1
build_powerplants 1 1 1
build_renewable_profiles 4 1 1
cluster_network 1 1 1
prepare_network 1 1 1
simplify_network 1 1 1
solve_network 1 1 1
total 13 1 1
Select jobs to execute...
[Sun Jan 30 17:13:10 2022]
rule base_network:
input: data/entsoegridkit/buses.csv, data/entsoegridkit/lines.csv, data/entsoegridkit/links.csv, data/entsoegridkit/converters.csv, data/entsoegridkit/transformers.csv, data/parameter_corrections.yaml, data/links_p_nom.csv, data/links_tyndp.csv, resources/country_shapes.geojson, resources/offshore_shapes.geojson, resources/europe_shape.geojson
output: networks/
base.nc log: logs/base_network.log
jobid: 6
benchmark: benchmarks/base_network
resources: tmpdir=C:\Users\felix\AppData\Local\Temp, mem_mb=500
C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\pyproj\__init__.py:89: UserWarning: pyproj unable to set database path.
_pyproj_global_context_initialize()
Traceback (most recent call last):
File "C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\.snakemake\scripts\
tmpzoipiwry.base_network.py", line 596, in <module>
n = base_network(snakemake.input.eg_buses, snakemake.input.eg_converters, snakemake.input.eg_transformers, snakemake.input.eg_lines, snakemake.input.eg_links,
File "C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\.snakemake\scripts\
tmpzoipiwry.base_network.py", line 547, in base_network
buses = _load_buses_from_eg(eg_buses, europe_shape, config['electricity'])
File "C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\.snakemake\scripts\
tmpzoipiwry.base_network.py", line 131, in _load_buses_from_eg
europe_shape = gpd.read_file(europe_shape).loc[0, 'geometry']
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\geopandas\io\file.py", line 244, in _read_file
return GeoDataFrame.from_features(
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\geopandas\geodataframe.py", line 610, in from_features
return GeoDataFrame(rows, columns=columns, crs=crs)
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\geopandas\geodataframe.py", line 126, in __init__
self._crs = CRS.from_user_input(crs) if crs else None
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\pyproj\crs\crs.py", line 479, in from_user_input
return cls(value, **kwargs)
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\site-packages\pyproj\crs\crs.py", line 326, in __init__
self._local.crs = _CRS(self.srs)
File "pyproj\_crs.pyx", line 2352, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection: epsg:4326: (Internal Proj Error: proj_create: no database context specified)
[Sun Jan 30 17:13:14 2022]
Error in rule base_network:
jobid: 6
output: networks/
base.nc log: logs/base_network.log (check log file(s) for error message)
RuleException:
CalledProcessError in line 112 of C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\Snakefile:
Command 'C:/Users/felix/.conda/envs/pypsa-eur/python.exe "C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\.snakemake\scripts\
tmpzoipiwry.base_network.py"' returned non-zero exit status 1.
File "C:\Users\felix\Documents\PythonScripts\PyPSA\pypsa-eur\Snakefile", line 112, in __rule_base_network
File "C:\Users\felix\.conda\envs\pypsa-eur\lib\concurrent\futures\thread.py", line 58, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message