Python Xarray ValueError: 未识别的分块管理器 dask – 必须是其中之一: []

huangapple go评论591阅读模式
英文:

Python Xarray ValueError: unrecognized chunk manager dask - must be one of: []

问题

这个问题的原因是由于不识别的块管理器(unrecognized chunk manager)引起的。可能是由于在使用xarray.open_mfdataset时,没有正确配置Dask块管理器或没有安装Dask库。您需要确保已正确设置Dask块管理器或安装了Dask库,以便xarray可以使用它来处理数据块。

英文:

I am using xarray for combining multiple netcdf files using xarray.open_mfdataset. But I get the error while running the command, below are the commands and error.

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

I get the following error-

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

What is causing the problem?

答案1

得分: 5

问题在我将xarray版本从2023.5.0降级到0.21.1后得以解决。

英文:

The issue was resolved when I downgraded the xarray version to 0.21.1 from 2023.5.0

答案2

得分: 1

It works by downgrading the xarray version to 2022.11.0.

英文:

it works by downgraded the xarray version to 2022.11.0

答案3

得分: 0

它在我使用最新的xarray-2023.7.0时对我有效,如果我先安装dask:pip install dask
xarray降级提示很有用,因为在dask上会出现"Module not found"错误,而不是上面的复杂错误消息,但在安装dask之后,我可以将xarray升级到最新版本,现在它正常工作。

英文:

It works for me with the latest xarray-2023.7.0 if I install dask first: pip install dask.
The xarray downgrade tip was useful as gives a 'Module not found' error on dask rather than the convoluted error message above, but after installing dask I was able to upgrade xarray to the latest and it works fine now.

huangapple
  • 本文由 发表于 2023年6月6日 04:50:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76409916.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定