Hello, I have been doing the tutorial Basic MEG and EEG data processing in your site and I don´t understand the problems I am having.
These are the versions of my mne and operating system:
- MNE version: 1.3.1
- operating system: macOS 12.5.1
So I ran the first steps:
import mne
mne.set_config(‘MNE_LOGGING_LEVEL’, ‘WARNING’, set_env=True)
mne.get_config_path()
from mne.datasets import sample # noqa
data_path = sample.data_path()
raw_fname = “mne_data/MNE-sample-data/MEG/sample/sample_audvis_filt-0-40_raw.fif”
print(raw_fname)
and those were ok. But then the problems started in the next steps.
raw = mne.io.read_raw_fif(raw_fname, add_eeg_ref=False)
and the error was
TypeError Traceback (most recent call last)
/var/folders/5r/3p26_bjj7j77h0337sf0xw2r0000gn/T/ipykernel_35427/2501877474.py in
----> 1 raw = mne.io.read_raw_fif(raw_fname, add_eeg_ref=False)
TypeError: read_raw_fif() got an unexpected keyword argument ‘add_eeg_ref’
I tried to run without the “add_eeg_ref=False” part and then the error was
FileNotFoundError Traceback (most recent call last)
/var/folders/5r/3p26_bjj7j77h0337sf0xw2r0000gn/T/ipykernel_35427/1001657568.py in
----> 1 raw = mne.io.read_raw_fif(raw_fname)
~/opt/anaconda3/lib/python3.9/site-packages/mne/io/fiff/raw.py in read_raw_fif(fname, allow_maxshield, preload, on_split_missing, verbose)
480 are updated accordingly.
481 “”"
→ 482 return Raw(fname=fname, allow_maxshield=allow_maxshield,
483 preload=preload, verbose=verbose,
484 on_split_missing=on_split_missing)
in init(self, fname, allow_maxshield, preload, on_split_missing, verbose)
~/opt/anaconda3/lib/python3.9/site-packages/mne/io/fiff/raw.py in init(self, fname, allow_maxshield, preload, on_split_missing, verbose)
79 while next_fname is not None:
80 raw, next_fname, buffer_size_sec =
—> 81 self._read_raw_file(next_fname, allow_maxshield,
82 preload, do_check_ext)
83 do_check_ext = False
in _read_raw_file(self, fname, allow_maxshield, preload, do_check_ext, verbose)
~/opt/anaconda3/lib/python3.9/site-packages/mne/io/fiff/raw.py in _read_raw_file(self, fname, allow_maxshield, preload, do_check_ext, verbose)
144 check_fname(fname, ‘raw’, endings)
145 # filename
→ 146 fname = _check_fname(fname, ‘read’, True, ‘fname’)
147 ext = os.path.splitext(fname)[1].lower()
148 whole_file = preload if ‘.gz’ in ext else False
in _check_fname(fname, overwrite, must_exist, name, need_dir, verbose)
~/opt/anaconda3/lib/python3.9/site-packages/mne/utils/check.py in _check_fname(fname, overwrite, must_exist, name, need_dir, verbose)
243 f’{name} does not have read permissions: {fname}‘)
244 elif must_exist:
→ 245 raise FileNotFoundError(f’{name} does not exist: {fname}')
246
247 return fname
FileNotFoundError: fname does not exist: /Users/margaridaserra/Downloads/wetransfer_filtica-ipynb_2023-03-14_2058/modeling_output/mne_data/MNE-sample-data/MEG/sample/sample_audvis_filt-0-40_raw.fif
I don´t understand why it says file not found in the beginning if in the previous command it printed the raw_fname and it seamed to be in the right path. I also don´t understand this final error, I don´t know why it is doing to the Downloads/wetransfer_filtica-ipynb_2023-03-14_2058/modeling_output/mne_data . I don´t want that folder now, I don´t understand this path.
Also is there a tutorial with only the EEG part and not the MEG?
Thank you!