Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
39446df
ENH: improve error message when FreeSurfer executable not found
ayuclan Mar 26, 2026
b682318
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2026
1d66ad3
Update mne/bem.py
ayuclan Mar 30, 2026
98d5e3b
Apply suggestions from code review
ayuclan Apr 12, 2026
e7144db
Add changelog entry for FreeSurfer error message improvement
ayuclan Apr 12, 2026
bed873d
Fix line length formatting
ayuclan Apr 13, 2026
2ee84be
Added author attribution to changelog entry for PR #13790.
ayuclan Apr 13, 2026
7a261a4
Fix changelog type to bugfix
ayuclan Apr 13, 2026
0c7ea19
Merge branch 'main' into fix-freesurfer-error-message
wmvanvliet Apr 17, 2026
dedf1b7
ENH: improve error message when FreeSurfer executable not found
ayuclan Mar 26, 2026
33e88e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2026
23a7271
Update mne/bem.py
ayuclan Mar 30, 2026
6053468
Apply suggestions from code review
ayuclan Apr 12, 2026
e54c691
Add changelog entry for FreeSurfer error message improvement
ayuclan Apr 12, 2026
5d9f7fc
Fix line length formatting
ayuclan Apr 13, 2026
9e546fc
Added author attribution to changelog entry for PR #13790.
ayuclan Apr 13, 2026
eba2001
Fix changelog type to bugfix
ayuclan Apr 13, 2026
0156366
DOC: Add contributor name to names.inc
ayuclan Apr 17, 2026
97a34ef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 17, 2026
cef7f8d
Merge branch 'fix-freesurfer-error-message' of github.com:ayuclan/mne…
wmvanvliet Apr 20, 2026
ca21318
Update doc/changes/dev/13790.bugfix.rst
larsoner Apr 20, 2026
28d33bc
Merge branch 'main' into fix-freesurfer-error-message
larsoner Apr 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13790.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved error message when FreeSurfer executable is not found, by :newcontrib:`Ayushi Satodiya`.
1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.. _Ashley Drew: https://github.com/ashdrew
.. _Asish Panda: https://github.com/kaichogami
.. _Austin Hurst: https://github.com/a-hurst
.. _Ayushi Satodiya: https://github.com/ayuclan
.. _Beige Jin: https://github.com/BeiGeJin
.. _Ben Beasley: https://github.com/musicinmybrain
.. _Benedikt Ehinger: https://www.benediktehinger.de
Expand Down
14 changes: 13 additions & 1 deletion mne/bem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,19 @@ def make_watershed_bem(
f"\nResults dir = {ws_dir}\nCommand = {' '.join(cmd)}\n"
)
os.makedirs(op.join(ws_dir))
run_subprocess_env(cmd)
try:
run_subprocess_env(cmd)
except FileNotFoundError as e:
raise RuntimeError(
"FreeSurfer executable 'mri_watershed' not found.\n\n"
"This usually means FreeSurfer is not properly configured.\n"
"Make sure:\n"
"- FREESURFER_HOME is set\n"
"- $FREESURFER_HOME/bin is in your PATH\n"
"- You started Python/Jupyter from a terminal where "
"SetupFreeSurfer.sh is sourced\n\n"
"See MNE installation documentation for details."
) from e
del tempdir # clean up directory
if op.isfile(T1_mgz):
new_info = _extract_volume_info(T1_mgz)
Expand Down