Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

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

I get the following error-

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: []

What is causing the problem?

like image 328
lsr729 Avatar asked Jul 27 '26 01:07

lsr729


2 Answers

For some unknown reason (to me), what I have found that works instead of performing any downgrade is to install all the packages needed (specially Xarray) and finally reinstall dask as:

conda install dask --force-reinstall

I have performed this in 4 environments and always has worked.

PS: I would also recommend using libmamba as the solver.

like image 174
Robert Chang Avatar answered Jul 28 '26 15:07

Robert Chang


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

like image 43
lsr729 Avatar answered Jul 28 '26 15:07

lsr729



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!