Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeWarning: Engine 'cfgrib' loading failed #196

Closed
Calebsakhtar opened this issue May 28, 2024 · 3 comments
Closed

RuntimeWarning: Engine 'cfgrib' loading failed #196

Calebsakhtar opened this issue May 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Calebsakhtar
Copy link

Description
Performing the installation python -m pip install "pycontrails[complete]" and running the example "Run CoCiP over a flight" (https://py.contrails.org/notebooks/run-cocip-on-flight.html) results in the following runtime warning:

RuntimeWarning: Engine 'cfgrib' loading failed: Cannot find the ecCodes library warnings.warn(f"Engine {name!r} loading failed:\n{ex}", RuntimeWarning)

Details

  • Version: pycontrails 0.51.0
  • Module: N/A
  • OS: Windows

Steps to Reproduce

  1. Create an anaconda environment: conda create --name pycontrails
  2. Activate the anaconda environment: conda activate pycontrails
  3. Install Python 3.9 to the environment: conda install python==3.9
  4. Install pycontrails using pip: python -m pip install "pycontrails[complete]"
  5. Run the example from the following link: https://py.contrails.org/notebooks/run-cocip-on-flight.html

Additional Notes
I have been able to eliminate this warning by running python -m pip install ecmwflibs. This solution was obtained here, but does not seem to be universal: ecmwf/eccodes-python#54 (comment)

@Calebsakhtar Calebsakhtar added the bug Something isn't working label May 28, 2024
@thabbott
Copy link
Contributor

Have you tested your eccodes installation with python -m eccodes selfcheck? If not, then I'd start with that to confirm that your environment can find the eccodes libraries. If you don't have them installed, you can install them using conda: see https://pypi.org/project/eccodes/.

All of that said, I've seen that warning before and it hasn't stopped me from running CoCiP. Unless you're having other issues that you think are connected to this warning you're probably safe to ignore it.

@Calebsakhtar
Copy link
Author

Thanks for your insight and quick response @thabbott. I did perform the test for my eccodes installation. The check could not find eccodes before running python -m pip install ecmwflibs, but did find it after running the command.

I was just worried the CoCiP results could be affected, but it doesn't seem to be the case. I leave it up to you whether you want to close this issue or leave it open.

@mlshapiro
Copy link
Contributor

@Calebsakhtar I took a closer look at this issue. Unfortunately ecmwflibs is a bit outdated and doesn't exist for Python 3.12.

I'm going to close this issue with the resolution that installing ecmwflibs on older versions of Python can help solve eecodes install issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants