我正在尝试使用pip安装cfgrib,使用以下方法:
pip3 install --user eccodes这将沿着以下路径安装eccode包:
/Library/name/Python/3.8/lib/python/site-packages当我试图运行python脚本(参见下面)时,我会收到一条错误消息,告诉我:
UserWarning: Failed to load cfgrib - most likely there is a problem accessing the ecCodes library. Try `import cfgrib` to get the full error messageimport numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import cfgrib
path = '/Users/name/Library/Python/3.8/bin'
fname = 'download.grib'
ds = xr.open_dataset(path+fname,engine = 'cfgrib',backend_kwargs={'indexpath':''})有人知道怎么解决这个问题吗?
发布于 2022-04-12 20:41:19
试一试
pip install ecmwflib
对我起作用了。
参考文献
https://stackoverflow.com/questions/71363633
复制相似问题