Unable to import mne version 1.3.1 (Error documenting cosine_score: 'stc_true_metric')

  • MNE version:1.3.1
  • operating system: Ubuntu 22.04

Recently went to run my code and got the following error message. This happens with just a single line of code import mne

KeyError                                  Traceback (most recent call last)
File ~/anaconda3/envs/jupyterEnv/lib/python3.10/site-packages/mne/utils/docs.py:3412, in fill_doc(f)
   3411 try:
-> 3412     f.__doc__ = docstring % indented
   3413 except (TypeError, ValueError, KeyError) as exp:

KeyError: 'stc_true_metric'

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
/home/roy/Desktop/github/Graph_Inference/Graph_inference/notebooks/7.0-analyze-alphaOverdelta.ipynb Cell 2 in ()
      1 # print mne version
----> 2 import mne
      3 print(mne.__version__)

File ~/anaconda3/envs/jupyterEnv/lib/python3.10/site-packages/mne/__init__.py:120, in 
    118 from . import minimum_norm
    119 from . import preprocessing
--> 120 from . import simulation
    121 from . import stats
    122 from . import surface

File ~/anaconda3/envs/jupyterEnv/lib/python3.10/site-packages/mne/simulation/__init__.py:7, in 
   3417                        % (funcname, str(exp)))
   3418 return f

RuntimeError: Error documenting cosine_score:


I can not reproduce if I install the version 1.3.1 in a fresh environment.
I suggest you try to setup a new environment and install the latest version.


1 Like

Hello ,

Even I was getting the same error with MNE version 1.4. I use Windows 10 as my OS. I had to uninstall Conda and all its environments. I downloaded Anaconda again, as always, and tried to use:

conda install --channel=conda-forge --name=base mamba
mamba create --override-channels --channel=conda-forge --name=mne mne

but I get the error no environment named ‘mne’ present. Though the execution was complete.

Also, the MNE standalone installer link for Windows does not work. I am not sure what is wrong.

There’s a bug in our website (the links are broken); @mscheltienne has been working on a fix:

I installed MNE using this link some hours ago. But, I am facing some issues:

…inner skull (2562) → inner skull (2562) …
Inverting the coefficient matrix (homog)…
Modify the original solution to incorporate IP approach…
Windows fatal exception: code 0xWindows fatal exception: code 0xc06d007f
Thread 0x00005114c06d007f
(most recent call first):
File “C:\MNE\lib\site-packages\ipykernel\parentpoller.py”, line 93 in run
File “C:\MNE\lib\threading.py”, line 1016 in _bootstrap_inner
File “C:\MNE\lib\threading.py”, line 973 in _bootstrap
Main thread:
Thread 0x000008cc (most recent call first):
File “<array_function internals>”, line 5 in dot
File “C:\MNE\lib\site-packages\mne\bem.py”, line 303 in _fwd_bem_ip_modify_solution
File “C:\MNE\lib\site-packages\mne\bem.py”, line 352 in _fwd_bem_linear_collocation_solution
File “C:\MNE\lib\site-packages\mne\bem.py”, line 452 in make_bem_solution
File “”, line 12 in make_bem_solution
File “…”, line 151 in
File “C:\MNE\lib\site-packages\spyder_kernels\py3compat.py”, line 356 in compat_exec
File “C:\MNE\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 473 in exec_code
File “C:\MNE\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 740 in _exec_cell
File “C:\MNE\lib\site-packages\spyder_kernels\customize\spydercustomize.py”, line 689 in runcell
File “~AppData\Local\Temp\ipykernel_19284\2644504182.py”, line 1 in
Restarting kernel…

I had faced the same issue when I used the MNE installer previously. This was resolved when I switched to the Conda route for downloading MNE. I am facing the same problem again. I cannot download MNE using Conda as mentioned previously. I am not sure what is wrong.

P.S- I do not have a core background in coding! there might be some trivial issues which I am missing.


For the ICA part, it is fixed in main and it will be fixed in the next minor release, 1.4.1. You could try to install the main version with pip install git+https://github.com/mne-tools/mne-python.