mne_icalabel ImportError
Ayumu722 opened this issue · 4 comments
Describe the bug
I installed mne-icalabel via conda and tried to use mne-icalable.
However, when I import the mne_icalabel, I got Import Error.
"ImportError: cannot import name '_INTERPOLATION_DEFAULT' from 'mne.defaults' (MYFOLDER\Anaconda3\envs\mne\lib\site-packages\mne\defaults.py)"
Steps to reproduce
I used anaconda, mne version 1.1.1 and mne_icalabel version 0.4
Actual results
from mne_icalabel import label_components
ImportError Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 from mne_icalabel import label_components
File ~\Anaconda3\envs\mne\lib\site-packages\mne_icalabel_init_.py:5, in
3 from . import annotation # noqa: F401
4 from . import datasets # noqa: F401
----> 5 from . import features # noqa: F401
6 from ._version import version # noqa: F401
7 from .label_components import label_components
File ~\Anaconda3\envs\mne\lib\site-packages\mne_icalabel\features_init_.py:3, in
1 """Features for the ICLabel"""
----> 3 from .topomap import get_topomaps
File ~\Anaconda3\envs\mne\lib\site-packages\mne_icalabel\features\topomap.py:5, in
3 import numpy as np
4 from mne.channels.layout import _find_topomap_coords
----> 5 from mne.defaults import _BORDER_DEFAULT, _EXTRAPOLATE_DEFAULT, _INTERPOLATION_DEFAULT
6 from mne.io import Info
7 from mne.io.pick import _get_channel_types, _pick_data_channels, _picks_to_idx, pick_info
ImportError: cannot import name '_INTERPOLATION_DEFAULT' from 'mne.defaults' (MYFOLDER\Anaconda3\envs\mne\lib\site-packages\mne\defaults.py)
Thank you for the report. We forgot to bump the requirement for mne
on conda
https://github.com/conda-forge/mne-icalabel-feedstock/blob/e04ecbb509ff9688cfe7f3b6b765764a3b941892/recipe/meta.yaml#L27
But mne 1.1
should work. Could you do
import mne
mne.sys_info()
and paste the output?
Thank you for the comments!
Below is the exact output of mne.sys_info()
Platform: Windows-10-10.0.19044-SP0
Python: 3.10.4 | packaged by conda-forge | (main, Mar 30 2022, 08:38:02) [MSC v.1916 64 bit (AMD64)]
Executable: C:\Users\ayumu\Anaconda3\envs\mne\python.exe
CPU: Intel64 Family 6 Model 85 Stepping 7, GenuineIntel: 36 cores
Memory: 191.7 GB
mne: 1.0.3
numpy: 1.22.3 {blas=mkl_rt, lapack=mkl_rt}
scipy: 1.7.3
matplotlib: 3.5.1 {backend=module://matplotlib_inline.backend_inline}
sklearn: 1.0.2
numba: Not found
nibabel: 3.2.2
nilearn: 0.9.1
dipy: 1.5.0
cupy: Not found
pandas: 1.4.2
pyvista: 0.34.0 {OpenGL 4.5.0 NVIDIA 516.40 via NVIDIA T1000 8GB/PCIe/SSE2}
pyvistaqt: 0.9.0
ipyvtklink: 0.2.2
vtk: 9.1.0
PyQt5: 5.12.3
ipympl: Not found
pooch: v1.6.0
mne_bids: 0.11.dev0
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: 0.3.1
mne_connectivity: Not found
Umm, it's weird. This said I have mne version 1.0.3, but the output of "conda list" said I have mne 1.1.1.
Is mne-base doing someting wrong??
mne 1.1.1 pypi_0 pypi
mne-base 1.0.3 pyh57928b3_3 conda-forge
Here you have it. I'm not sure how you have set up your environment, but for some reason, it's picking up 2 mne installations. It's not mne-base
, could you try to create a new environment and install mne
and mne-icalabel
in it?
conda create -n test
conda install mne
conda install mne-icalabel
And then check the output of sys_info
again.
Note that I separated the install of mne
and mne-icalabel
for 2 reasons:
- That will install
mne
with all the dependencies and not only the base dependencies (mne-base
, equivalent topip install mne
) - The requirement for
mne
is wrong in the recipe formne-icalabel
(1.0 instead of 1.1), will be fixed in conda-forge/mne-icalabel-feedstock#9
Thanks!!
I did
conda create -n test
conda install -c conda-forge mne
conda install -c conda-forge mne-icalabel
import mne
mne.sys_info()
and got below.
Platform: Windows-10-10.0.19044-SP0
Python: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:30:19) [MSC v.1929 64 bit (AMD64)]
Executable: C:\Users\ayumu\Anaconda3\envs\test\python.exe
CPU: Intel64 Family 6 Model 85 Stepping 7, GenuineIntel: 36 cores
Memory: 191.7 GB
mne: 1.1.1
numpy: 1.22.3 {blas=NO_ATLAS_INFO, lapack=lapack}
scipy: 1.9.1
matplotlib: 3.5.3 {backend=module://matplotlib_inline.backend_inline}
sklearn: 1.1.2
numba: 0.55.2
nibabel: 4.0.2
nilearn: 0.9.2
dipy: 1.5.0
cupy: Not found
pandas: 1.4.4
pyvista: 0.36.1 {OpenGL 4.5.0 NVIDIA 516.40 via NVIDIA T1000 8GB/PCIe/SSE2}
pyvistaqt: 0.9.0
ipyvtklink: 0.2.2
vtk: 9.1.0
qtpy: 2.2.0 {PyQt5=5.15.4}
ipympl: Not found
pyqtgraph: 0.12.4
pooch: v1.6.0
mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: 0.3.2
mne_connectivity: Not found
mne_icalabel: 0.4
Now I have mne version 1.1.1 and in this environment, I was able to import mne_icalabel!
I really appreciate your kind help!