An error occurs when I import mne_connectivity

  • MNE version: e.g. 0.23.0
  • operating system: Windows 10

AttributeError Traceback (most recent call last)
in
7 from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator
8 from mne.viz import circular_layout
----> 9 from mne_connectivity import spectral_connectivity_epochs
10 from mne_connectivity.viz import plot_connectivity_circle

D:\ProgramData\Anaconda\lib\site-packages\mne_connectivity_init_.py in
9 version = ‘0.3’
10
—> 11 from .base import (Connectivity, EpochConnectivity, EpochSpectralConnectivity,
12 EpochSpectroTemporalConnectivity, EpochTemporalConnectivity,
13 SpectralConnectivity, SpectroTemporalConnectivity,

D:\ProgramData\Anaconda\lib\site-packages\mne_connectivity\base.py in
2
3 import numpy as np
----> 4 import xarray as xr
5 import pandas as pd
6 from mne.utils import (_check_combine, _check_option, _validate_type,

D:\ProgramData\Anaconda\lib\site-packages\xarray_init_.py in
----> 1 from . import testing, tutorial
2 from .backends.api import (
3 load_dataarray,
4 load_dataset,
5 open_dataarray,

D:\ProgramData\Anaconda\lib\site-packages\xarray\testing.py in
7 import pandas as pd
8
----> 9 from xarray.core import duck_array_ops, formatting, utils
10 from xarray.core.dataarray import DataArray
11 from xarray.core.dataset import Dataset

D:\ProgramData\Anaconda\lib\site-packages\xarray\core\duck_array_ops.py in
24 from numpy import where as _where
25
—> 26 from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils
27 from .nputils import nanfirst, nanlast
28 from .pycompat import cupy_array_type, dask_array_type, is_duck_dask_array

D:\ProgramData\Anaconda\lib\site-packages\xarray\core\dask_array_compat.py in
58
59 if da is not None:
—> 60 sliding_window_view = da.lib.stride_tricks.sliding_window_view
61 else:
62 sliding_window_view = None

AttributeError: module ‘dask.array’ has no attribute ‘lib’

It’s a problem with Dask support in xarray. You can try to update Dask, or downgrade xarray to version 2022.3.

Best wishes,
Richard

1 Like