Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resolve this AttributeError when using eccodes/grib?

I'm working with cfgrib on macOS and I'm getting the following error when I try to use covert a grib file into xarray:

AttributeError: module 'pyeccodes.compat' has no attribute 'codes_grib_multi_support_off'

Here's the code I have so far:

import xarray as xr

import matplotlib.pyplot as plt
import matplotlib.style as sty
sty.use('classic')

import numpy as np

import cartopy.crs as ccrs
d7 = xr.open_dataset('2007_BLH.grib', engine='cfgrib')

I've downloaded everything that seems to be needed, including eccodes, pyeccodes, cfgrib. How can I resolve this issue?

like image 324
100mypete Avatar asked May 01 '26 21:05

100mypete


1 Answers

Install the ecCodes binary with the package manager, see: https://github.com/ecmwf/cfgrib#binary-dependencies.

like image 96
HumphreysCarter Avatar answered May 04 '26 11:05

HumphreysCarter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!