Crash stc.plot() after mne update

Hi all, now I am using:

  • MNE version: 0.24.0
  • OS: Linux-5.4.0-77-generic-x86_64-with-debian-bullseye-sid
    I recently updated the package mne to version 0.22.10 to 0.24.0 and now I am getting the error, when i try to run stc.plot():

AttributeError: ‘vtkmodules.vtkRenderingUI.vtkGenericRenderWindowIn’ object has no attribute ‘initialize’

What could be the cause of the error?

list environment packages

mne.sys_info()
Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.
Platform: Linux-5.4.0-77-generic-x86_64-with-debian-bullseye-sid
Python: 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0]
Executable: /opt/anaconda3/envs/py37/bin/python
CPU: x86_64: 32 cores
Memory: 125.9 GB

mne: 0.24.0
numpy: 1.20.2 {blas=NO_ATLAS_INFO, lapack=lapack}
scipy: 1.6.2
matplotlib: 3.3.4 {backend=Qt5Agg}

sklearn: 0.24.1
numba: 0.53.1
nibabel: 3.2.1
nilearn: 0.7.1
dipy: 1.4.0
cupy: Not found
pandas: 1.2.3
mayavi: 4.7.2
pyvista: 0.29.0 {OpenGL 3.3 (Core Profile) Mesa 20.0.8 via llvmpipe (LLVM 10.0.0, 256 bits)}
pyvistaqt: 0.3.0
ipyvtklink: Not found

full bug report

stc.plot()
Using control points [ 4.11800842 5.04983401 13.54983059]
Traceback (most recent call last):

File “”, line 1, in
stc.plot()

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/source_estimate.py”, line 666, in plot
verbose=verbose)

File “”, line 24, in plot_source_estimates

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/_3d.py”, line 1879, in plot_source_estimates
brain_kwargs=brain_kwargs, **kwargs)

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/_3d.py”, line 1955, in _plot_stc
brain = Brain(**kwargs)

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/_brain/_brain.py”, line 531, in init
fig=figure)

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/backends/renderer.py”, line 41, in _get_renderer
return backend._Renderer(*args, **kwargs)

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/backends/_qt.py”, line 648, in init
super().init(*args, **kwargs)

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/backends/_pyvista.py”, line 187, in init
self.plotter = self.figure.build()

File “/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/viz/backends/_pyvista.py”, line 105, in build
self.plotter.iren.initialize()

AttributeError: ‘vtkmodules.vtkRenderingUI.vtkGenericRenderWindowIn’ object has no attribute ‘initialize’

Hello @Kirill, your PyVista and pyvistaqt are outdated.

We recommend to create a new environment from scratch when updating MNE-Python, to ensure one has the correct versions of all dependencies.

Best wishes,
Richard

1 Like