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