cannot import snirf data under MNE-NIRS

  • MNE version: 1.2.1.0
  • operating system: Windows 10 21H2

mne.io.read_raw_snirf() gives me the first challenge when I am trying to use MEN-NIRS for the first time.
raw_intensity = mne.io.read_raw_snirf(“C:\Users\qguo5\Desktop\FirstPhaseData\psychark\ftt\xxxx.snirf”)
here’s the error massage:

Traceback (most recent call last):

  File "C:\Users\qguo5\AppData\Local\Temp\ipykernel_236\2038925264.py", line 1, in <cell line: 1>
    raw_intensity = mne.io.read_raw_snirf("C:\\Users\\qguo5\\Desktop\\FirstPhaseData\\psychark\\ftt\\xxxx.snirf")

  File "C:\ProgramData\mne-python\1.2.1_0\lib\site-packages\mne\io\snirf\_snirf.py", line 54, in read_raw_snirf
    return RawSNIRF(fname, optode_frame, preload, verbose)

  File "<decorator-gen-312>", line 12, in __init__

  File "C:\ProgramData\mne-python\1.2.1_0\lib\site-packages\mne\io\snirf\_snirf.py", line 87, in __init__
    h5py = _import_h5py()

  File "C:\ProgramData\mne-python\1.2.1_0\lib\site-packages\mne\utils\check.py", line 153, in _import_h5py
    _require_version('h5py', 'read MATLAB files >= v7.3')

  File "C:\ProgramData\mne-python\1.2.1_0\lib\site-packages\mne\utils\check.py", line 148, in _require_version
    raise ImportError(f'The {lib} package{extra} is required to {what}, '

ImportError: The h5py package is required to read MATLAB files >= v7.3, package was not found

spontaneously I would go check if I have install the h5py package. I just did pip install h5py and It seems everything works fine.

pip install h5py
Requirement already satisfied: h5py in c:\programdata\mne-python\1.2.1_0\lib\site-packages (3.7.0)Note: you may need to restart the kernel to use updated packages.

Requirement already satisfied: numpy>=1.14.5 in c:\programdata\mne-python\1.2.1_0\lib\site-packages (from h5py) (1.21.6)

Then I have no ideas why. Much appreciated if you have any idea why.XD