【问题标题】:ValueError using MetPy and xarray使用 MetPy 和 xarray 的 ValueError
【发布时间】:2021-08-14 06:01:02
【问题描述】:

我正在尝试使用来自https://unidata.github.io/MetPy/latest/examples/Four_Panel_Map.html#sphx-glr-download-examples-four-panel-map-py 的一些脚本来制作天气图,但我发现运行此脚本时出现了这个问题:

Traceback (most recent call last):
  File "C:/Users/fedec/PycharmProjects/met2/four-panel.py", line 46, in <module>
    ds = xr.open_dataset(get_test_data('gfs_output.nc', False))
  File "C:\Users\fedec\PycharmProjects\met2\venv\lib\site-packages\xarray\backends\api.py", line 480, in open_dataset
    engine = plugins.guess_engine(filename_or_obj)
  File "C:\Users\fedec\PycharmProjects\met2\venv\lib\site-packages\xarray\backends\plugins.py", line 111, in guess_engine
    raise ValueError(
ValueError: did not find a match in any of xarray's currently installed IO backends ['scipy', 'zarr']. Consider explicitly selecting one of the installed backends via the ``engine`` parameter to xarray.open_dataset(), or installing additional IO dependencies:
http://xarray.pydata.org/en/stable/getting-started-guide/installing.html
http://xarray.pydata.org/en/stable/user-guide/io.html

Process finished with exit code 1

我认为我在使用 xarray 时遇到了一些问题,所以我尝试这样做升级我的 xarray: 点安装“xarray [io]” 点安装“xarray [完成]” 但我得到相同的ValueError。 Python 3.8 版 有什么想法吗?提前致谢! 费德

【问题讨论】:

    标签: python python-xarray metpy


    【解决方案1】:

    该特定数据文件采用 netCDF-4 格式,zarr 或 scipy 都不支持。我很惊讶安装 xarray[io]xarray[complete] 并没有解决它。尝试手动执行pip install netcdf4

    (如果这不起作用,请在此处发表评论并使用新错误更新上面的回溯。)

    【讨论】:

      猜你喜欢
      • 2020-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-09
      • 2020-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多