Re: [pypsa] [PyPSA-Eur] Electricity only Tutorial

104 views
Skip to first unread message
Message has been deleted

Johannes Hampp

unread,
Aug 2, 2023, 3:05:44 PM8/2/23
to Tommaso Ficara, pypsa
Dear Tommasco,

Seems like you are missing the "fiona" package. It is part of the
environment.yaml and should be properly installed.

Can you check if that is the case (conda list -> check for "fiona").

Best,
Johannes

On 02/08/2023 19:17, Tommaso Ficara wrote:
> Dear All,
>
> I am writing to you as I am experiencing some issues while running the
> "Electricity only" tutorial. I looked at a similar discussion, but none
> of the solutions worked in my
> case: https://groups.google.com/g/pypsa/c/HPqbMScQTMs/m/g__pknqVAQAJ
>
> After following the Installation guide and running "/% snakemake -call
> results/test-elec/networks/elec_s_6_ec_lcopt_Co2L-24H.nc --configfile
> config/test/config.electricity.yaml" /I get the following errors:
>
> ###
>
> Traceback (most recent call last):
>   File
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmpcmyomx9x.build_ship_raster.py", line 52, in <module>
>     import rioxarray
>   File
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rioxarray\__init__.py", line 5, in <module>
>     import rioxarray.raster_array  # noqa
>   File
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rioxarray\raster_array.py", line 19, in <module>
>     import rasterio
>   File
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rasterio\__init__.py", line 28, in <module>
>     from rasterio._version import gdal_version, get_geos_version,
> get_proj_version
> ImportError: DLL load failed while importing _version: Die angegebene
> Prozedur wurde nicht gefunden.
> [Wed Aug  2 16:10:23 2023]
> Error in rule build_ship_raster:
>     jobid: 15
>     input: data/shipdensity_global.zip, cutouts/be-03-2013-era5.nc,
> cutouts/be-03-2013-era5.nc, cutouts/be-03-2013-era5.nc,
> cutouts/be-03-2013-era5.nc
>     output: resources/shipdensity_raster.tif
>     log: logs/test-elec/build_ship_raster.log (check log file(s) for
> error details)
>     conda-env:
> C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\conda\4c18c7584804aa3f0bf13d63bf59fb79_
>
> Traceback (most recent call last):
>   File
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmp27zu_81t.build_shapes.py", line 262, in <module>
>     country_shapes = countries(snakemake.input.naturalearth,
> snakemake.params.countries)
>   File
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmp27zu_81t.build_shapes.py", line 120, in countries
>     df = gpd.read_file(naturalearth)
>   File
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\geopandas\io\file.py", line 255, in _read_file
>     engine = _check_engine(engine, "'read_file' function")
>   File
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\geopandas\io\file.py", line 114, in _check_engine
>     raise ImportError(
> ImportError: The 'read_file' function requires the 'pyogrio' or 'fiona'
> package, but neither is installed or imports correctly.
> Importing fiona resulted in: DLL load failed while importing _env: Die
> angegebene Prozedur wurde nicht gefunden.
> Importing pyogrio resulted in: No module named 'pyogrio'
> [Wed Aug  2 16:10:27 2023]
> Error in rule build_shapes:
>     jobid: 8
>     input: data/bundle/naturalearth/ne_10m_admin_0_countries.shp,
> data/bundle/eez/World_EEZ_v8_2014.shp,
> data/bundle/NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp,
> data/bundle/nama_10r_3popgdp.tsv.gz, data/bundle/nama_10r_3gdp.tsv.gz,
> data/bundle/ch_cantons.csv, data/bundle/je-e-21.03.02.xls
>     output: resources/country_shapes.geojson,
> resources/offshore_shapes.geojson, resources/europe_shape.geojson,
> resources/nuts3_shapes.geojson
>     log: logs/test-elec/build_shapes.log (check log file(s) for error
> details)
>     conda-env:
> C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\conda\4c18c7584804aa3f0bf13d63bf59fb79_
>
> Shutting down, this might take some time.
> Exiting because a job execution failed. Look above for error message
> Complete log: .snakemake\log\2023-08-02T161018.157058.snakemake.log
>
> ###
>
> I am running an up-to date  pypsa clone of the repository. I also
> updated it via conda env update -f envs/environment.yaml.
> Any help would be very appreciated.
>
> Thanks in advance,
>
> Best regards,
> Tommaso
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com <https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Message has been deleted

Johannes Hampp

unread,
Aug 3, 2023, 2:56:15 AM8/3/23
to Tommaso Ficara, pypsa
Dear Tommasco,

This also sounds like an issue specific to your environment, again I can
only repeat it should be installed through environment.yaml . Make sure
that rioxarray is also installed from conda-forge.

In general we test PyPSA-EUR on windows only under WSL2 ; there are just
too many random issues popping up from directly running the model in
Windows.

https://pypsa-eur.readthedocs.io/en/latest/index.html#operating-systems

Best,
Johannes

On 02/08/2023 22:00, Tommaso Ficara wrote:
> Dear Johannes,
>
> Thanks for the swift reply. There might have been a problem while
> loading the environment;, fiona and pyogro are installed. I still get
> the first part of the error concerning rioxarray (see below). Any clue
> what the issue could be? Many thanks.
>
> ###
> Traceback (most recent call last):
>   File
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmpzpjmmnki.build_ship_raster.py <http://tmpzpjmmnki.build_ship_raster.py>", line 52, in <module>
>     import rioxarray
>   File
> "C:\Users\tommaso.ficara\Miniconda3\envs\pypsa-eur\lib\site-packages\rioxarray\__init__.py", line 5, in <module>
>     import rioxarray.raster_array  # noqa
>   File
> "C:\Users\tommaso.ficara\Miniconda3\envs\pypsa-eur\lib\site-packages\rioxarray\raster_array.py", line 19, in <module>
>     import rasterio
>   File
> "C:\Users\tommaso.ficara\Miniconda3\envs\pypsa-eur\lib\site-packages\rasterio\__init__.py", line 28, in <module>
>     from rasterio._version import gdal_version, get_geos_version,
> get_proj_version
> ImportError: DLL load failed while importing _version: Die angegebene
> Prozedur wurde nicht gefunden.
> [Wed Aug  2 21:48:17 2023]
> Error in rule build_ship_raster:
>     jobid: 15
>     input: data/shipdensity_global.zip, cutouts/be-03-2013-era5.nc
> <http://be-03-2013-era5.nc>, cutouts/be-03-2013-era5.nc
> <http://be-03-2013-era5.nc>, cutouts/be-03-2013-era5.nc
> <http://be-03-2013-era5.nc>, cutouts/be-03-2013-era5.nc
> <http://be-03-2013-era5.nc>
>     output: resources/shipdensity_raster.tif
>     log: logs/test-elec/build_ship_raster.log (check log file(s) for
> error details)
>     conda-env:
> C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\conda\4c18c7584804aa3f0bf13d63bf59fb79_
>
> [Wed Aug  2 21:48:24 2023]
> Finished job 8.
> 1 of 16 steps (6%) done
> Shutting down, this might take some time.
> Exiting because a job execution failed. Look above for error message
> Complete log: .snakemake\log\2023-08-02T214812.790664.snakemake.log
> ####
>
> Best regards,
> Tommaso
>
> Il giorno mer 2 ago 2023 alle ore 21:05 Johannes Hampp
> <johanne...@zeu.uni-giessen.de
> <mailto:johanne...@zeu.uni-giessen.de>> ha scritto:
>
> Dear Tommasco,
>
> Seems like you are missing the "fiona" package. It is part of the
> environment.yaml and should be properly installed.
>
> Can you check if that is the case (conda list -> check for "fiona").
>
> Best,
> Johannes
>
> On 02/08/2023 19:17, Tommaso Ficara wrote:
> > Dear All,
> >
> > I am writing to you as I am experiencing some issues while
> running the
> > "Electricity only" tutorial. I looked at a similar discussion,
> but none
> > of the solutions worked in my
> > case:
> https://groups.google.com/g/pypsa/c/HPqbMScQTMs/m/g__pknqVAQAJ
> <https://groups.google.com/g/pypsa/c/HPqbMScQTMs/m/g__pknqVAQAJ>
> >
> > After following the Installation guide and running "/% snakemake
> -call
> > results/test-elec/networks/elec_s_6_ec_lcopt_Co2L-24H.nc
> --configfile
> > config/test/config.electricity.yaml" /I get the following errors:
> >
> > ###
> >
> > Traceback (most recent call last):
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmpcmyomx9x.build_ship_raster.py <http://tmpcmyomx9x.build_ship_raster.py>", line 52, in <module>
> >      import rioxarray
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rioxarray\__init__.py", line 5, in <module>
> >      import rioxarray.raster_array  # noqa
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rioxarray\raster_array.py", line 19, in <module>
> >      import rasterio
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\envs\pypsa-eur\lib\site-packages\rasterio\__init__.py", line 28, in <module>
> >      from rasterio._version import gdal_version, get_geos_version,
> > get_proj_version
> > ImportError: DLL load failed while importing _version: Die
> angegebene
> > Prozedur wurde nicht gefunden.
> > [Wed Aug  2 16:10:23 2023]
> > Error in rule build_ship_raster:
> >      jobid: 15
> >      input: data/shipdensity_global.zip,
> cutouts/be-03-2013-era5.nc <http://be-03-2013-era5.nc>,
> > cutouts/be-03-2013-era5.nc <http://be-03-2013-era5.nc>,
> cutouts/be-03-2013-era5.nc <http://be-03-2013-era5.nc>,
> > cutouts/be-03-2013-era5.nc <http://be-03-2013-era5.nc>
> >      output: resources/shipdensity_raster.tif
> >      log: logs/test-elec/build_ship_raster.log (check log file(s)
> for
> > error details)
> >      conda-env:
> >
> C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\conda\4c18c7584804aa3f0bf13d63bf59fb79_
> >
> > Traceback (most recent call last):
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmp27zu_81t.build_shapes.py <http://tmp27zu_81t.build_shapes.py>", line 262, in <module>
> >      country_shapes = countries(snakemake.input.naturalearth,
> > snakemake.params.countries)
> >    File
> >
> "C:\Users\tommaso.ficara\Anaconda3\pypsa-eur\.snakemake\scripts\tmp27zu_81t.build_shapes.py <http://tmp27zu_81t.build_shapes.py>", line 120, in countries
> <mailto:pypsa%2Bunsu...@googlegroups.com>
> > <mailto:pypsa+un...@googlegroups.com
> <mailto:pypsa%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com <https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com> <https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pypsa/226a3baa-b4bd-4c2a-902b-7866e2e5c469n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
Reply all
Reply to author
Forward
0 new messages