Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NumPy library ImportError: DLL load failed: The specified procedure could not be found

I'm learning python using Visual Studio 2017 on Windows 10. When I'm trying to import NumPy library into my code, this error appears. I have tried uninstalling and reinstalling, looking for libiomp5md.dll per instruction in ImportError: DLL load failed when importing Numpy installed in conda virtual environment but to no prevail.

Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\adm\documents\visual studio 2017\Projects\Web Scraping\Web Scraping\Web_Scraping.py", line 17, in <module>
import numpy
  File "C:\Program Files\Python36\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
  File "C:\Program Files\Python36\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
  File "C:\Program Files\Python36\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
  File "C:\Program Files\Python36\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
  File "C:\Program Files\Python36\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy. 
If you're working with a numpy git repo, try `git clean -xdf` (removes all 
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: The specified procedure could not be found.
like image 466
Hoang V. Pham Avatar asked Jun 14 '17 06:06

Hoang V. Pham


People also ask

How do you fix Importerror DLL load failed the specified module could not be found?

importerror: dll load failed: The specified module could not be found error occurs because of the incompatibilities of Microsoft Visual C++ (Visual Studio) versions. The best way to fix this error (importerror: dll load failed) is to reinstall/ install the Microsoft Visual C++ distribution.

How can I fix Importerror DLL load failed the specified module could not be found in Python 3?

In this case, you should uninstall the library first, then update the pip, and finally install the library again. Besides, if the error occurs, because the module is too new, you can solve the problem by installing the module with a specified version.

How do I check Numpy version in Anaconda prompt?

Make sure you are using the Anaconda prompt, as the conda command only works in an Anaconda environment, and type conda list numpy . The result will show the version of numpy and associated packages.


1 Answers

I encountered the same problem with VSCode, and I resolved it by adding the following path to the system environment. After that restart VSCode and everything is OK.

C:\Users\<Your user name>\Anaconda3\Library\bin

If the anaconda was not installed in the default directory, please find your own Anaconda3\Library\bin.

like image 173
user1024 Avatar answered Oct 08 '22 07:10

user1024