MNE Installation Problem for environment

When I tried to install the MNE, I did not get the package running. I tried to make a new environment for MNE. However, it gives me an empty environment. Could you please help me here? By the way, I am following this link:

https://mne.tools/stable/install/mne_python.html#for-3d-plotting-and-source-analysis

Hi @pronob,
could you explain in more detail what went wrong - what commands did you use and what deviated from your expectations? Did something happen when creating the environment - an error message maybe? Why do you think the environment is empty?

I am using these lines of code:
curl --remote-name https://raw.githubusercontent.com/mne-tools/mne-python/main/server_environment.yml
conda create --name=mne --file=server_environment.yml

It gives an environment without any error. However, when I used conda activate mne it provides an error.

what error do you get?

Alex

Now, it gives an error do not even create an environment. The error is CondaValueError: could not parse ‘name: base’ in: server_environment.yml

Could you please post all the output from the terminal?

(mne) D:>mne sys_info
Traceback (most recent call last):
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\numpy\core_init_.py”, line 23, in
from . import multiarray
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\numpy\core\multiarray.py”, line 10, in
from . import overrides
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\numpy\core\overrides.py”, line 6, in
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\Admin\anaconda3\envs\mne\lib\runpy.py”, line 197, in run_module_as_main
return run_code(code, main_globals, None,
File “C:\Users\Admin\anaconda3\envs\mne\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\Admin\anaconda3\envs\mne\Scripts\mne.exe_main
.py", line 4, in
File "C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\mne_init
.py", line 22, in
from .utils import (set_log_level, set_log_file, verbose, set_config,
File "C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\mne\utils_init
.py", line 9, in
from .check import (check_fname, check_version, check_random_state,
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\mne\utils\check.py”, line 19, in
import numpy as np
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\numpy_init_.py”, line 144, in
from . import core
File “C:\Users\Admin\anaconda3\envs\mne\lib\site-packages\numpy\core_init_.py”, line 49, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.9 from “C:\Users\Admin\anaconda3\envs\mne\python.exe”
  • The NumPy version is: “1.22.1”

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named ‘numpy.core._multiarray_umath’

Try “conda env create” instead of “conda create” ?

The other error:

This might be happening because of the incompatible python and numpy versions. I am not sure how your python version is Python3.9 here instead of 3.8 as per the server_environment.yml file. I think you should remove the environment with “conda env remove -n mne” and then create a new one again with “conda env create --name=mne --file=server_environment.yml”.

Hi @pronob
I had the numpy error you post yesterday when setting up an mne environement. At one point (when resolving some issues with spyder) some of my packages were updated to the normal conda channel from conda-forge and this seems to have led to some binary incompatibilities.
You can try updating numpy and other packages to the version from conda-forge and see if that fixes your problem:

conda upgrade -c conda-forge --all