diff --git a/mne/bem.py b/mne/bem.py index bb73544f763..221569ee817 100644 --- a/mne/bem.py +++ b/mne/bem.py @@ -1313,7 +1313,18 @@ 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: + 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." + ) del tempdir # clean up directory if op.isfile(T1_mgz): new_info = _extract_volume_info(T1_mgz)