I installed anaconda3 on windows 11 x64 using the online installer. I can import numpy if i launch python from the anaconda command prompt but if i try to import numpy from python that is launched from normal command prompt I get this error:
$ python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see Managing environments — conda 23.10.1.dev61 documentation
Type “help”, “copyright”, “credits” or “license” for more information.
import numpy as np
C:\ProgramData\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:\ProgramData\Anaconda3\lib\site-packages\numpy\core_init.py", line 22, in
from . import multiarray
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\multiarray.py”, line 12, in
from . import overrides
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\overrides.py”, line 7, in
from numpy.core._multiarray_umath import (
ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 1, in
File “C:\ProgramData\Anaconda3\lib\site-packages\numpy_init_.py”, line 145, in
from . import core
File “C:\ProgramData\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.9 from “C:\ProgramData\Anaconda3\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: DLL load failed while importing _multiarray_umath: The specified module could not be found.
How can I fix this please? I added C:\ProgramData\Anaconda3; to the PATH so that I could run python from normal command prompt.
Note that I do not have any other versions of Python on my system. This is a brand new Windows 11 computer.
This is my PATH
C:\Users\siddj>PATH
PATH=C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\ProgramData\Anaconda3;C:\Users\siddj\AppData\Local\Microsoft\WindowsApps;C:\Users\siddj\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\siddj.dotnet\tools;C:\ProgramData\Anaconda3;