0

I installed the last version of Miniconda and created a new environment.

I have pip installed the following repos:

pip install git+https://git.ufz.de/FINAM/finam.git

pip install git+https://git.ufz.de/FINAM/finam-netcdf.git

pip install git+https://git.ufz.de/FINAM/finam-plot.git

pip install git+https://git.ufz.de/FINAM/finam-graph.git

Finally, I cloned this repo

git clone https://git.ufz.de/FINAM/finam-examples.git

In that repo I ran two files component.py and pet_calculator.py located at:

~/finam-examples/01_Hargreaves-Samani/src/

I first ran component.py, and that was ok.

The problem came when I ran pet_calculator.py.

This is my error:

(test) sh-3.2$ /Users/lealroja/miniconda3/envs/test/bin/python /Users/lealroja/Documents/UFZ/finam_project/finam-examples/01_Hargreaves-Samani/src/pet_calculator.py
2023-02-19 23:09:44,109 INFO: init composition                     - FINAM
Traceback (most recent call last):
  File "/Users/lealroja/Documents/UFZ/finam_project/finam-examples/01_Hargreaves-Samani/src/pet_calculator.py", line 49, in <module>
    composition.initialize()
  File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam/schedule.py", line 148, in initialize
    mod.initialize()
  File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam/sdk/component.py", line 65, in initialize
    self._initialize()
  File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/finam_netcdf/reader.py", line 191, in _initialize
    self.dataset = xr.open_dataset(self.path)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/xarray/backends/api.py", line 510, in open_dataset
    engine = plugins.guess_engine(filename_or_obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lealroja/miniconda3/envs/test/lib/python3.11/site-packages/xarray/backends/plugins.py", line 177, in guess_engine
    raise ValueError(error_msg)
ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'scipy']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
https://docs.xarray.dev/en/stable/user-guide/io.html

I have that error when using a Mac book Pro. However, when I do the exact same procedure and run it in Ubuntu I have no issues.

I am not an expert, and therefore I have no idea what to do. Could you please help me?

I have tried answers from this links:

Thank you in advance.

jei L
  • 33
  • 6
  • Sorry but there isn’t enough information here in the question to help. Questions on stack overflow should stand alone and not depend on answerers digging through code on another site. Can you please include the full traceback, the actual code being run, and more info about the file you’re trying to open? You likely just need to install a dependency, but we can’t tell which. Also, it’s recommended that you install xarray and it’s depencencies using conda, not pip. So you might have more luck if you pre-install the dependencies in a new conda environment, ideally using the `conda-forge` channel. – Michael Delgado Feb 19 '23 at 21:30
  • Thank you for the response, I have added the traceback. I hope it helps – jei L Feb 19 '23 at 22:10
  • Please make this more easily reproducible. No one is going to follow the steps you’ve provided. You should be able to extract the 2 or 3 lines of code that are actually causing the problem and showing them in the question. – Robert Wilson Feb 20 '23 at 07:43
  • it seems that my *.nc file was corrupted. I tried `ncdump -h file.nc` on my command line, then I replaced the file and it worked. – jei L Feb 20 '23 at 16:29

0 Answers0