# Unable to import mne version 1.3.1 (Error documenting cosine\_score: 'stc\_true\_metric')

**URL:** <https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941>\
**Category:** Support & Discussions\
**Created:** [May 22, 2023, 8:18pm UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941 "2023-05-22T20:18:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aroyphillips](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/aroyphillips/32/2666_2.png) [@aroyphillips](https://mne.discourse.group/u/aroyphillips)\
**Post date:** [May 22, 2023, 8:18pm UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/1 "2023-05-22T20:18:04Z")

</div>

- 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 `

```python
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:
'stc_true_metric'

```

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [May 23, 2023, 1:26pm UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/2 "2023-05-23T13:26:54Z")

</div>

Hello,

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.

Mathieu

---

<div class="post-metadata">

**Author:** ![Srijita](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/srijita/32/2689_2.png) [@Srijita](https://mne.discourse.group/u/Srijita)\
**Post date:** [May 27, 2023, 10:16pm UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/3 "2023-05-27T22:16:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [May 28, 2023, 6:52am UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/4 "2023-05-28T06:52:38Z")

</div>

> [@Srijita](#):
>
> 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:

> [@Unable to download the linux version of mne](https://mne.discourse.group/t/unable-to-download-the-linux-version-of-mne/6978/2):
>
> Definitely a bug, and same error on all 4 platforms… PR opened here to fix it: [Fix installer links by mscheltienne · Pull Request #11709 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/pull/11709) In the meantime, you can find the installers here: [Releases · mne-tools/mne-installers · GitHub](https://github.com/mne-tools/mne-installers/releases/) Mathieu

---

<div class="post-metadata">

**Author:** ![Srijita](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/srijita/32/2689_2.png) [@Srijita](https://mne.discourse.group/u/Srijita)\
**Post date:** [May 28, 2023, 7:18pm UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/6 "2023-05-28T19:18:27Z")

</div>

> [@Unable to download the linux version of mne](https://mne.discourse.group/t/unable-to-download-the-linux-version-of-mne/6978/2):
>
> In the meantime, you can find the installers here: [Releases · mne-tools/mne-installers · GitHub](https://github.com/mne-tools/mne-installers/releases/)

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

- ICA\_plot\_components renders only the first plot window opens after which the code hangs unless keyboard interrupted, something similar to this [ICA plot\_components opens figure one by one (and might hang depending on the console) · Issue #11693 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/11693). I had to change the source code when I was using the MNE downloaded by Conda which resolved the issue. I am facing this again.

- I am trying to calculate the BEM but this is what I get:

> …inner skull (2562) → inner skull (2562) …  
> Inverting the coefficient matrix (homog)…  
> Modify the original solution to incorporate IP approach…  
> Combining…  
> 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.

Thanks!

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [May 29, 2023, 9:08am UTC](https://mne.discourse.group/t/unable-to-import-mne-version-1-3-1-error-documenting-cosine-score-stc-true-metric/6941/7 "2023-05-29T09:08:26Z")

</div>

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`.
