problem with stc.plot

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

  • MNE version: e.g. 1.6.1
  • operating system: e.g. macOS 13 m2 silicon

I am testing the 10_review.py, which is provided on the website, to check the installation. but got stuck in the step:

plot the STC

stc.plot(
initial_time=0.1, hemi=β€œsplit”, views=[β€œlat”, β€œmed”], subjects_dir=subjects_dir
)

I met the problem, which will be presented as followings:

Fatal Python error: Segmentation fault

Main thread:
Current thread 0x00000001fe88a080 (most recent call first):
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 1176 in create_module
File β€œβ€, line 571 in module_from_spec
File β€œβ€, line 674 in _load_unlocked
File β€œβ€, line 1006 in _find_and_load_unlocked
File β€œβ€, line 1027 in _find_and_load
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/pyvista/core/_vtk_core.py”, line 309 in
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 883 in exec_module
File β€œβ€, line 688 in _load_unlocked
File β€œβ€, line 1006 in _find_and_load_unlocked
File β€œβ€, line 1027 in _find_and_load
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 1078 in _handle_fromlist
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/pyvista/core/init.py”, line 4 in
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 883 in exec_module
File β€œβ€, line 688 in _load_unlocked
File β€œβ€, line 1006 in _find_and_load_unlocked
File β€œβ€, line 1027 in _find_and_load
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/pyvista/init.py”, line 9 in
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 883 in exec_module
File β€œβ€, line 688 in _load_unlocked
File β€œβ€, line 1006 in _find_and_load_unlocked
File β€œβ€, line 1027 in _find_and_load
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/mne/viz/backends/_qt.py”, line 20 in
File β€œβ€, line 241 in _call_with_frames_removed
File β€œβ€, line 883 in exec_module
File β€œβ€, line 688 in _load_unlocked
File β€œβ€, line 1006 in _find_and_load_unlocked
File β€œβ€, line 1027 in _find_and_load
File β€œβ€, line 1050 in _gcd_import
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/importlib/init.py”, line 126 in import_module
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/mne/viz/backends/renderer.py”, line 44 in _reload_backend
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/mne/viz/backends/renderer.py”, line 178 in _get_3d_backend
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/mne/viz/_3d.py”, line 2405 in plot_source_estimates
File β€œβ€, line 12 in plot_source_estimates
File β€œ/Users/sandrokrieg/anaconda3/lib/python3.10/site-packages/mne/source_estimate.py”, line 743 in plot
File β€œ/var/folders/bm/vjj4zjtn00qb526npxt1gp940000gn/T/ipykernel_4451/2809451616.py”, line 28 in

Restarting kernel…

I have installed the pyvista. it seems to be the version problem. Could you pls help me to check it?

Thank you very much.

Hello and welcome to the forum!

The error indicates an installation issue. Could you please try to install MNE-Python following our official installation instructions?

Best wishes,
Richard

It is nice to have your reply. The installer was used for the installation.

This morning I redo the installation, and it is still same when running the
#plot the STC
stc.plot(
initial_time=0.1, hemi=β€œsplit”, views=[β€œlat”, β€œmed”], subjects_dir=subjects_dir
)

the Is it the problem related to the compatibility of Freesurfer (version 7.3.2) and M2 Silicon?

when I try to install using Conda,

conda install --channel=conda-forge --name=base conda-libmamba-solver
conda create --solver=libmamba --override-channels --channel=conda-forge --name=mne mne, it shows:
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate mne

To deactivate an active environment, use

$ conda deactivate

the same problem came.

Thank you very much once again.

When I test the installation using code as follows:

python -c β€œimport mne; mne.sys_info()”

it shows:

Platform macOS-13.5-arm64-arm-64bit
Python 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:35:25) [Clang 16.0.6 ]
Executable /Users/sandrokrieg/anaconda3/bin/python
CPU arm (24 cores)
Memory 192.0 GB

Core
β”œβ˜‘ mne 1.6.1 (latest release)
β”œβ˜‘ numpy 1.26.3 (OpenBLAS 0.3.21 with 24 threads)
β”œβ˜‘ scipy 1.11.4
β”œβ˜‘ matplotlib 3.8.0 (backend=MacOSX)
β”œβ˜‘ pooch 1.7.0
β””β˜‘ jinja2 3.1.2

Numerical (optional)
β”œβ˜‘ sklearn 1.4.0
β”œβ˜‘ nibabel 5.2.0
β”œβ˜‘ dipy 1.8.0
β””β˜ unavailable numba, nilearn, openmeeg, cupy, pandas

Visualization (optional)
zsh: segmentation fault python -c β€œimport mne; mne.sys_info()”.

Hello, thanks for the additional information.

This problem has nothing to do with FreeSurfer.

From the error messages and system info you posted, it can be deduced that you’re neither running MNE as deployed by the installer, nor from the freshly-created conda environment. Instead, it seems to be running from you β€œbase” conda environment, which may cause issues.

Can you try to run from the installer (via the MNE Prompt), or from the correct conda environment (after calling conda activate mne)?

Good luck,
Richard