Trouble installing mne_icalabel

mne v. 1.3.1
mne_icalabel 0.4
Linux pop-os 6.2.6-76060206-generic #202303130630~1679424972~22.04~4a8cde1 SMP PREEMPT_DYNAMIC Tue M x86_64 x86_64 x86_64 GNU/Linux

MWE:

import os
import mne
from mne.preprocessing import ICA
from mne_icalabel import label_components

Error:

Output exceeds the size limit. Open the full output data in a text editor---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[18], line 4
      2 import mne
      3 from mne.preprocessing import ICA
----> 4 from mne_icalabel import label_components

File ~/anaconda3/envs/neurogram/lib/python3.10/site-packages/mne_icalabel/__init__.py:3
      1 """Automatic ICA labeling for MEG, EEG and iEEG data."""
----> 3 from . import annotation  # noqa: F401
      4 from . import datasets  # noqa: F401
      5 from . import features  # noqa: F401

File ~/anaconda3/envs/neurogram/lib/python3.10/site-packages/mne_icalabel/annotation/__init__.py:1
----> 1 from .bids import mark_component, write_components_tsv

File ~/anaconda3/envs/neurogram/lib/python3.10/site-packages/mne_icalabel/annotation/bids.py:7
      4 from mne.preprocessing import ICA
      5 from mne.utils import _check_pandas_installed
----> 7 from ..config import ICLABEL_LABELS_TO_MNE
      8 from ..iclabel.config import ICLABEL_STRING_TO_NUMERICAL
     11 def write_components_tsv(ica: ICA, fname):

File ~/anaconda3/envs/neurogram/lib/python3.10/site-packages/mne_icalabel/config.py:1
----> 1 from .iclabel import iclabel_label_components
...
    231 # Appease the type checker; ordinarily this binding is inserted by the
    232 # torch._C module initialization code in C
    233 if TYPE_CHECKING:

ImportError: /home/john/anaconda3/envs/neurogram/lib/python3.10/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: cudaGraphInstantiateWithFlags, version libcudart.so.11.0

I have no idea what to do about cudaGraphInstantiateWithFlags, and google isn’t turning up anything.

Thanks for any help.

Hello,

This is not the full traceback, so I can not say for sure; but this seems to be an issue with your pytorch installation (which is used by mne-icalabel). Could you try to reinstall pytorch with those instructions on this page: https://pytorch.org/

Mathieu

Thanks for the reply!
There seems to be some weird interaction with other libraries I’m loading.
I changed the ordering and fiddled around, then it started working. I put things back, and it still worked. Somewhere in there I reinstalled libcudnn 8.6.163, which I think installing mne-icalabel downgradded to 8.5.x. :person_shrugging:

1 Like

mne-icalabel downgradded to 8.5.x.

Not exactly as mne-icalabel maximum version is 0.4 :wink: But yes, libcudnn might have been the culprit in the faulty pytorch installation. Glad you fixed it!

Mathieu

Yes, I didn’t word that too carefully. I mean that installing mne-icalabel downgraded libcudnn to 8.5.x.

1 Like