If you have a question or issue with MNE-Python, please include the following info:

  • MNE-Python version: 0.22.0
  • operating system: windows
    I can’t read_ch_connectivity:
    I get the error message :

import mne
from mne.channels import read_ch_connectivity

Traceback (most recent call last):
  File "<ipython-input-3-0e32996ab1c0>", line 1, in <module>
    from mne.channels import read_ch_connectivity

ImportError: cannot import name 'read_ch_connectivity' from 'mne.channels' (C:\Users\name\Anaconda3\envs\mne\lib\site-packages\mne\channels\__init__.py)

That worked before mne upgrade. Any idea, what’s wrong?

Hello @LeilaNS,

in that release, a number of functions were renamed:

The function you want to use is called mne.channels.read_ch_adjacency() now.

Hope that helps!

Thank you for fast answer. I have an other same question :

Brain = mne.viz.get_brain_class()
AttributeError: 'module' object has no attribute 'get_brain_class'

Are you sure you’re using MNE-Python 0.22 when running this command? I just checked (albeit on macOS), and it does work for me.

 python -c "import mne; mne.sys_info()"

 Python:        3.8.6 | packaged by conda-forge | (default, Dec 26 2020, 05:05:16)  [GCC 9.3.0]
 mne:           0.22.0
 numpy:         1.19.5 {blas=NO_ATLAS_INFO, lapack=lapack}
 scipy:         1.6.0
 matplotlib:    3.3.3 {backend=Qt5Agg}
 sklearn:       0.24.0
 numba:         0.52.0
 nibabel:       3.2.1
 nilearn:       0.7.0
 dipy:          1.3.0
 cupy:          Not found
 pandas:        1.2.0
 mayavi:        4.7.2
 pyvista:       0.27.4 {pyvistaqt=0.2.0, OpenGL 4.6 (Core Profile) Mesa 20.0.8 via Mesa DRI Intel(R) UHD Graphics 630 (CFL GT2)}
 vtk:           9.0.1
 PyQt5:         5.12.3

Which operating system are you using? Is this Linux?

I really cannot reproduce this with 0.22. I wonder if your installation is corrupted, or maybe you’re using a development version of 0.22? Could you try to force-reinstall MNE by running

pip install -U mne

I reinstalled MNE again now it works. Thank you for your help

Perfect! Good to know it works now.