I’ve tried to create an environment with Python 3.7 and numpy 1.18 in order to be compatible with an application. The environment, py37-gmat, was created through Navigator, I activated the environment and started a command window from the Environments pane, the terminal showed that py37-gmat was the active environment. I used conda in the terminal to install numpy=1.18. The package was installed successfully and the Navigator Environment pane shows numpy 1.18.5 installed (attached)…
Note: PYTHONPATH is not set for this test.
Note: Anaconda Navigator 2.1.1 on Windows 10,
Open a terminal window from the environment using the Navigator, start python and import numpy. The import fails with the notorious:
“ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’”
The terminal output shows python 3.7.12 but tries to import the numpy 1.20.3 from the base environment, which fails due to compatibility issues between python3.7 and numpy versions greater than 1.18. The terminal output is as follows:
(py37-gmat) C:\Users\Colin>python
Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:37:49) [MSC v.1916 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.import numpy
C:\Users\Colin\anaconda3\Lib\site-packages\numpy_init_.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see GitHub - IntelPython/mkl-service: Python hooks for Intel(R) Math Kernel Library runtime control settings.
from . import distributor_init
Traceback (most recent call last):
File "C:\Users\Colin\anaconda3\Lib\site-packages\numpy\core_init.py", line 22, in
from . import multiarray
File “C:\Users\Colin\anaconda3\Lib\site-packages\numpy\core\multiarray.py”, line 12, in
from . import overrides
File “C:\Users\Colin\anaconda3\Lib\site-packages\numpy\core\overrides.py”, line 7, 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 “”, line 1, in
File “C:\Users\Colin\anaconda3\Lib\site-packages\numpy_init_.py”, line 145, in
from . import core
File “C:\Users\Colin\anaconda3\Lib\site-packages\numpy\core_init_.py”, line 48, 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.7 from “C:\Users\Colin\anaconda3\envs\py37-gmat\python.exe”
- The NumPy version is: “1.20.3”
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’