Cong Nguyen
Cong Nguyen

Reputation: 21

numpy is installed but I got the error "DLL load failed while importing _multiarray_umath: The specified module could not be found."

I am using the Anaconda distribution with Python 3.9. Among the packages installed, I have numpy, pandas, etc. In PyCharm IDE, I have set the Project Interpreter to be the path to the python.exe installed with Anaconda: C:\Users\[user]\anaconda3\envs[Tensorflow]\pythonw.exe

P.S: I have tried every method to fix this problem on stack overflow from including more paths to uninstall and reinstall but none of those work. Please help!

C:\Users\nguye\anaconda3\envs\[Tensorflow]\pythonw.exe C:/Users/nguye/PycharmProjects/tensorEnv/main.py
Traceback (most recent call last):
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\__init__.py", line 23, in <module>
    from . import multiarray
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\overrides.py", line 6, in <module>
    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 "C:\Users\nguye\PycharmProjects\tensorEnv\main.py", line 3, in <module>
    import tensorflow
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\python\__init__.py", line 37, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\tensorflow\python\eager\context.py", line 26, in <module>
    import numpy as np
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\__init__.py", line 144, in <module>
    from . import core
  File "C:\Users\nguye\anaconda3\envs\[Tensorflow]\lib\site-packages\numpy\core\__init__.py", line 49, in <module>
    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\nguye\anaconda3\envs\[Tensorflow]\pythonw.exe"
  * The NumPy version is: "1.22.2"

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.


Process finished with exit code 1

Upvotes: 2

Views: 1646

Answers (1)

Awadi Ghassen
Awadi Ghassen

Reputation: 41

I faced same issue and fixed it by adding the following variables to system environment PATH:

C:\Users\[username]\anaconda3
C:\Users\[username]\anaconda3\Scripts
C:\Users\[username]\anaconda3\Library\bin

Resource link

Upvotes: 0

Related Questions