首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过pip在WSL2上未正确安装Cfgrib

通过pip在WSL2上未正确安装Cfgrib
EN

Stack Overflow用户
提问于 2021-02-28 22:32:38
回答 1查看 498关注 0票数 2

我正在尝试将cfgrib安装到我的WSL2 Ubuntu上,但是当我输入python3 -m cfgrib selfcheck时,它给出了如下错误。

代码语言:javascript
复制
Traceback (most recent call last):
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 42, in <module>
    import pyeccodes.compat as eccodes
ModuleNotFoundError: No module named 'pyeccodes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 184, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.8/runpy.py", line 143, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.8/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/__init__.py", line 19, in <module>
    from .cfmessage import CfMessage
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/cfmessage.py", line 29, in <module>
    from . import messages
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 44, in <module>
    raise exc
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py", line 37, in <module>
    from . import bindings as eccodes
  File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/bindings.py", line 57, in <module>
    raise RuntimeError(f"ecCodes library not found using {LIBNAMES}")
RuntimeError: ecCodes library not found using ['eccodes', 'libeccodes.so', 'libeccodes']

我的python版本是Python 3.8.2。可以通过pip安装cfgrib吗?

EN

回答 1

Stack Overflow用户

发布于 2021-02-28 23:07:02

PyPI doesn't declare eccodes or pyeccodes as a dependency上最新发布的cfgrib版本0.9.8.5,甚至没有额外的版本。您可以单独安装其中一个:

代码语言:javascript
复制
pip install eccodes

代码语言:javascript
复制
pip install pyeccodes

(我不知道有什么不同;cfgrib可以use both)。

bug is fixed in the repository,但尚未发布到PyPI,因此您可以尝试使用git安装最新版本

代码语言:javascript
复制
pip install --upgrade "git+https://github.com/ecmwf/cfgrib.git#egg=cfgrib"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66410132

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档