AssersionError during read_raw_fif function in tutorial example

  • MNE version: 1.8.0
  • operating system: Windows 11

Hello everyone, I’m new to MNE-python and attempt to simulate MEG signals. I’ve installed the mne package, and copied script from the tutorial example Corrupt known signal with point spread. An AssersionError occurs when Loading the MEG data in

raw = mne.io.read_raw_fif(data_path / “MEG” / “sample” / “sample_audvis_raw.fif”)

with error message

AssertionError <code object times at 0x00000162758E9BB0, file “d:\Anaconda\envs\mne\Lib\site-packages\mne\io\base.py”, line 1893> != <code object _arange_div at 0x00000162723C16B0, file “d:\Anaconda\envs\mne\Lib\site-packages\mne\utils\numerics.py”, line 1065>

KeyError: (1065, ‘d:\Anaconda\envs\mne\Lib\site-packages\mne\utils\numerics.py’, <code object _arange_div at 0x00000162723C16B0, file “d:\Anaconda\envs\mne\Lib\site-packages\mne\utils\numerics.py”, line 1065>)

It seems that there are inconsistency between file base.py and numerics.py. I’ve searched in the forum but found no similar issues. How can I fix it? Thanks!

I suspect this issue could be related to version compatibility. Are you using Python version 3.9?

It’s probably a version/environment issue. The simplest fix is to recreate the environment and re-install MNE.

Mathieu

1 Like

Thanks. I was using python 3.12. The error is fixed after I changed the version to 3.9

Note that MNE-Python 1.8 is the last version to support Python 3.9. All newer versions will require 3.10 or newer. If this is a new project you’re working on, please consider using Python 3.12.

Best wishes,
Richard

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.