0

我正在尝试打开 zarr 文件,

import pandas as pd
import xarray as xr
xf = xr.open_zarr("../../data/processed/geolink_norge_dataset/geolink_norge_well_logs.zarr")

但是出现了错误:


ValueError                                Traceback (most recent call last) <ipython-input-17-ff38d9c54463> in <module>
      1 import pandas as pd
      2 import xarray as xr
----> 3 xf = xr.open_zarr("../../data/processed/geolink_norge_dataset/geolink_norge_well_logs.zarr")
      4 
      5 # We will use just the 30* wells

C:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\zarr.py in open_zarr(store, group, synchronizer, chunks, decode_cf, mask_and_scale, decode_times, concat_characters, decode_coords, drop_variables, consolidated, overwrite_encoded_chunks, chunk_store, storage_options, decode_timedelta, use_cftime, **kwargs)
    685     }
    686 
--> 687     ds = open_dataset(
    688         filename_or_obj=store,
    689         group=group,

C:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\api.py in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, backend_kwargs,
*args, **kwargs)
    480         engine = plugins.guess_engine(filename_or_obj)
    481 
--> 482     backend = plugins.get_backend(engine)
    483 
    484     decoders = _resolve_decoders_kwargs(

C:\ProgramData\Anaconda3\lib\site-packages\xarray\backends\plugins.py in get_backend(engine)
    132         engines = list_engines()
    133         if engine not in engines:
--> 134             raise ValueError(
    135                 f"unrecognized engine {engine} must be one of: {list(engines)}"
    136             )

ValueError: unrecognized engine zarr must be one of: ['scipy','store']

任何人都可以帮助解决这个问题吗?我可以确认我已经安装了 scipy 和 store 包。

4

1 回答 1

0

您可能还需要安装 zarr 软件包:

pip install zarr

如果这不起作用,请尝试:

pip install xarray[complete]

有关更多信息,请参阅https://github.com/pydata/xarray/issues/5395#issuecomment-850483726

于 2021-06-03T07:25:40.857 回答