Python Xarray ValueError:无法识别的块管理器 dask - 必须是以下之一:[]

问题描述 投票:0回答:3

我正在使用

xarray
来使用
xarray.open_mfdataset
组合多个 netcdf 文件。但是我在运行命令时收到错误,下面是命令和错误。

nc_all = xarray.open_mfdataset(files,combine = 'nested', concat_dim="time")
files = glob.glob("/filepath/*")

我收到以下错误-

Traceback (most recent call last):
  File "/home/lsrathore/GLEAM/GLEAM_HPC.py", line 85, in <module>
    nc_1980_90 = xarray.open_mfdataset(files[1:11],combine = 'nested', concat_dim="time")
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 1038, in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 1038, in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 572, in open_dataset
    ds = _dataset_from_backend_dataset(
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 367, in _dataset_from_backend_dataset
    ds = _chunk_ds(
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/backends/api.py", line 315, in _chunk_ds
    chunkmanager = guess_chunkmanager(chunked_array_type)
  File "/home/lsrathore/.local/lib/python3.9/site-packages/xarray/core/parallelcompat.py", line 87, in guess_chunkmanager
    raise ValueError(
ValueError: unrecognized chunk manager dask - must be one of: []

是什么导致了这个问题?

python netcdf python-xarray netcdf4
3个回答
4
投票

当我将

xarray
版本从2023.5.0降级到0.21.1时,问题得到解决


0
投票

它的工作原理是将 xarray 版本降级为 2022.11.0


0
投票

如果我先安装 dask,它适用于最新的 xarray-2023.7.0:

pip install dask

xarray 降级提示很有用,因为在 dask 上给出了“模块未找到”错误,而不是上面的复杂错误消息,但在安装 dask 后,我能够将 xarray 升级到最新版本,现在工作正常。

© www.soinside.com 2019 - 2024. All rights reserved.