Python:运行时错误:安装cfgrib后,使用['eccodes',' libeccodes.so','libeccodes']找不到ecCodes库

dsf9zpds  于 2023-04-22  发布在  Python
关注(0)|答案(2)|浏览(458)

我在macOS上安装了cfgrib,方法如下

python3.8 -m pip install cfgrib

现在如果我打开尝试导入cfgrib

import cfgrib

我明白

RuntimeError: ecCodes library not found using ['eccodes', 'libeccodes.so', 'libeccodes']

我通过homebrew安装了cfgrib解决了这个问题。

brew install eccodes
gxwragnw

gxwragnw1#

cfgrib包依赖于eccodes python包来访问ECMWF ecCodes二进制库。因此安装:

pip install eccodes

之后,您可以尝试:

python -m cfgrib selfcheck

你应该得到这样的输出:

Found: ecCodes v2.20.0.
Your system is ready.

希望这能解决你的问题。
如果没有,也许你必须安装错误消息中监听的软件包。

46scxncf

46scxncf2#

对我有用的是:

pip install ecmwflibs
import ecmwflibs
pip install cfgrib
import cfgrib

相关问题