# error to plot source estimate

**URL:** <https://mne.discourse.group/t/error-to-plot-source-estimate/11605>\
**Category:** Support & Discussions\
**Created:** [November 29, 2025, 2:27am UTC](https://mne.discourse.group/t/error-to-plot-source-estimate/11605 "2025-11-29T02:27:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aclesage](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@aclesage](https://mne.discourse.group/u/aclesage)\
**Post date:** [November 29, 2025, 2:27am UTC](https://mne.discourse.group/t/error-to-plot-source-estimate/11605/1 "2025-11-29T02:27:28Z")

</div>

Dear all,

im am running the jupyter notebook 10\_overview in visual studio code 3

everything runs fine except

the last piece of code

\</\>

# path to subjects’ MRI files

subjects\_dir = sample\_data\_folder / “subjects”

# plot the STC

stc.plot(

initial\_time=0.1, hemi=“split”, views=[“lat”, “med”], subjects\_dir=subjects\_dir

)\</\>

i get a Runtime Error

* * *

RuntimeError Traceback (most recent call last)  
Cell In[21], line 4  
2 subjects\_dir = sample\_data\_folder / “subjects”  
3 # plot the STC  
----\> 4 stc.plot(  
5 initial\_time=0.1, hemi=“split”, views=[“lat”, “med”], subjects\_dir=subjects\_dir  
6 )

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mne/source\_estimate.py:790, in \_BaseSourceEstimate.plot(self, subject, surface, hemi, colormap, time\_label, smoothing\_steps, transparent, alpha, time\_viewer, subjects\_dir, figure, views, colorbar, clim, cortex, size, background, foreground, initial\_time, time\_unit, backend, spacing, title, show\_traces, src, volume\_options, view\_layout, add\_data\_kwargs, brain\_kwargs, verbose)  
755 @copy\_function\_doc\_to\_method\_doc(plot\_source\_estimates)  
756 def plot(  
757 self,  
(…) 788 verbose=None,  
789 ):  
→ 790 brain = plot\_source\_estimates(  
791 self,  
792 subject,  
793 surface=surface,  
794 hemi=hemi,  
795 colormap=colormap,  
796 time\_label=time\_label,  
797 smoothing\_steps=smoothing\_steps,  
798 transparent=transparent,  
799 alpha=alpha,  
800 time\_viewer=time\_viewer,  
801 subjects\_dir=subjects\_dir,  
802 figure=figure,  
803 views=views,  
804 colorbar=colorbar,  
805 clim=clim,  
806 cortex=cortex,  
807 size=size,  
808 background=background,  
809 foreground=foreground,  
810 initial\_time=initial\_time,  
811 time\_unit=time\_unit,  
812 backend=backend,  
813 spacing=spacing,  
814 title=title,  
815 show\_traces=show\_traces,  
816 src=src,  
817 volume\_options=volume\_options,  
818 view\_layout=view\_layout,  
819 add\_data\_kwargs=add\_data\_kwargs,  
820 brain\_kwargs=brain\_kwargs,  
821 verbose=verbose,  
822 )  
823 return brain

File :12, in plot\_source\_estimates(stc, subject, surface, hemi, colormap, time\_label, smoothing\_steps, transparent, alpha, time\_viewer, subjects\_dir, figure, views, colorbar, clim, cortex, size, background, foreground, initial\_time, time\_unit, backend, spacing, title, show\_traces, src, volume\_options, view\_layout, add\_data\_kwargs, brain\_kwargs, verbose)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mne/viz/\_3d.py:2518, in plot\_source\_estimates(stc, subject, surface, hemi, colormap, time\_label, smoothing\_steps, transparent, alpha, time\_viewer, subjects\_dir, figure, views, colorbar, clim, cortex, size, background, foreground, initial\_time, time\_unit, backend, spacing, title, show\_traces, src, volume\_options, view\_layout, add\_data\_kwargs, brain\_kwargs, verbose)  
2516 if backend == “auto”:  
2517 try:  
→ 2518 backend = \_get\_3d\_backend()  
2519 except (ImportError, ModuleNotFoundError):  
2520 warn(“No 3D backend found. Resorting to matplotlib 3d.”)

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/mne/viz/backends/renderer.py:181, in \_get\_3d\_backend()  
179 break  
180 else:  
→ 181 raise RuntimeError(  
182 “Could not load any valid 3D backend\n”  
183 + “\n”.join(f"{key}: {val}" for key, val in errors.items())  
184 + “\n”.join(  
185 (  
186 “\n\n install pyvistaqt, using pip or conda:”,  
187 “‘pip install pyvistaqt’”,  
188 “‘conda install -c conda-forge pyvistaqt’”,  
189 "\n or install ipywidgets, "  
190 + “if using a notebook backend”,  
191 “‘pip install ipywidgets’”,  
192 “‘conda install -c conda-forge ipywidgets’”,  
193 )  
194 )  
195 )  
197 else:  
198 MNE\_3D\_BACKEND = \_check\_3d\_backend\_name(MNE\_3D\_BACKEND)

RuntimeError: Could not load any valid 3D backend  
pyvistaqt: No module named ‘qtpy’  
notebook: No module named ‘ipyevents’

install pyvistaqt, using pip or conda:  
‘pip install pyvistaqt’  
‘conda install -c conda-forge pyvistaqt’

or install ipywidgets, if using a notebook backend  
‘pip install ipywidgets’  
‘conda install -c conda-forge ipywidgets’

i installed ipywidgets with pip but does not work

I do not use conda so far

**when i run** mne.sys\_info()

Platform macOS-13.3-arm64-arm-64bit

Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)]

Executable /usr/local/bin/python3

CPU Apple M2 Max (12 cores)

Memory 64.0 GiB

Core

├☑ mne 1.11.0 (unable to check for latest version on GitHub, SSL error)

├☑ numpy 2.1.3 (OpenBLAS 0.3.27 with 12 threads)

├☑ scipy 1.16.0

└☑ matplotlib 3.10.7 (backend=macosx)

Numerical (optional)

├☑ sklearn 1.7.1

├☑ pandas 2.3.1

├☑ h5py 3.14.0

└☐ unavailable numba, nibabel, nilearn, dipy, openmeeg, cupy, h5io

Visualization (optional)

├☑ ipywidgets 8.1.8

└☐ unavailable pyvista, pyvistaqt, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser, trame\_client, trame\_server, trame\_vtk, trame\_vuetify

Ecosystem (optional)

├☑ defusedxml 0.7.1

└☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, curryreader, mffpy, pybv, antio

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [December 4, 2025, 10:39am UTC](https://mne.discourse.group/t/error-to-plot-source-estimate/11605/2 "2025-12-04T10:39:41Z")

</div>

Here is the relevant bit of the error message:

```python
install pyvistaqt, using pip or conda:
‘pip install pyvistaqt’
‘conda install -c conda-forge pyvistaqt’

```

You need to install the `pyvistaqt` package in your python environment. We use this to draw 3D figures.
