ImportError: cannot import name 'dask_array_type' from 'xarray.core.pycompat' #7569
Answered
by
dcherian
douglatornell
asked this question in
Q&A
-
I'm considering using the https://github.com/yt87/pywgrib2_xr package. It hasn't been updated since Mar-2021. When I use it with Traceback (most recent call last):
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/bin/pywgrib2", line 33, in <module>
sys.exit(load_entry_point('pywgrib2-xr==0.2.3', 'console_scripts', 'pywgrib2')())
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/bin/pywgrib2", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/lib/python3.9/site-packages/pywgrib2_xr/__init__.py", line 30, in <module>
from .accessor import Wgrib2DatasetAccessor
File "/home/doug/conda_envs/pywgrib2-xarray-2022.11/lib/python3.9/site-packages/pywgrib2_xr/accessor.py", line 9, in <module>
from xarray.core.pycompat import dask_array_type
ImportError: cannot import name 'dask_array_type' from 'xarray.core.pycompat' (/home/doug/conda_envs/pywgrib2-xarray-2022.11/lib/python3.9/site-packages/xarray/core/pycompat.py) Looking at the present from xarray.core.pycompat import dask_array_type to from xarray.core.pycompat import array_type
dask_array_type = array_type("dask") Is this correct, or is there a better way?
if isinstance(u_var.data, dask_array_type):
... |
Beta Was this translation helpful? Give feedback.
Answered by
dcherian
Feb 28, 2023
Replies: 1 comment 1 reply
-
Well they shouldn't be doing that, this is private API. You'll have to edit that package to fix it. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dcherian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well they shouldn't be doing that, this is private API. You'll have to edit that package to fix it.