google / google/weather-tools

ecCodes required by cfgrib for running weather-mv

Open
#225 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
252
Forks
60
Avg merge
8d 4h
Merged PRs (30d)
3

Description

Running the following command in a python 3.8 environment created with `pip` from `main` branch fails:

```bash
weather-mv rg --uris "gs://$BUCKET/download/*.nc" --output_path "gs://$BUCKET/download-rg-$(date +%s)/" --dry-run
```

error:
```raw
[...]
/venv38/lib/python3.8/site-packages/xarray/backends/cfgrib_.py:29: UserWarning: Failed to load cfgrib - most likely there is a problem accessing the ecCodes library. Try import cfgrib to get the full error message
warnings.warn(
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md
```

full trace when importing in python shell:
```raw
(venv38-rg) friedrich@basel $ python
Python 3.8.13 (default, Aug 27 2022, 18:46:53)
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cfgrib
Traceback (most recent call last):
File "", line 1, in
File "/venv38-rg/lib/python3.8/site-packages/cfgrib/__init__.py", line 20, in
from .cfmessage import COMPUTED_KEYS
File "/venv38-rg/lib/python3.8/site-packages/cfgrib/cfmessage.py", line 29, in
from . import abc, messages
File "/venv38-rg/lib/python3.8/site-packages/cfgrib/messages.py", line 28, in
import eccodes # type: ignore
File "/venv38-rg/lib/python3.8/site-packages/eccodes/__init__.py", line 13, in
from .eccodes import * # noqa
File "/venv38-rg/lib/python3.8/site-packages/eccodes/eccodes.py", line 12, in
from gribapi import (
File "/venv38-rg/lib/python3.8/site-packages/gribapi/__init__.py", line 13, in
from .gribapi import * # noqa
File "/venv38-rg/lib/python3.8/site-packages/gribapi/gribapi.py", line 34, in
from gribapi.errors import GribInternalError
File "/venv38-rg/lib/python3.8/site-packages/gribapi/errors.py", line 16, in
from .bindings import ENC, ffi, lib
File "/venv38-rg/lib/python3.8/site-packages/gribapi/bindings.py", line 35, in
raise RuntimeError("Cannot find the ecCodes library")
RuntimeError: Cannot find the ecCodes library
>>>
```

Adding `ecmwflibs==0.4.17` to the requirements seems to resolve the issue (see [here](https://github.com/ecmwf/eccodes-python/issues/54)).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.