问题描述
我正在Windows 10上使用Visual Studio 2017学习python,当我尝试将NumPy库导入我的代码时,出现此错误.我尝试卸载并重新安装,在,但没有成功.
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.
推荐答案
我在VSCode中遇到了相同的问题,我通过在系统环境中添加以下路径来解决了该问题.之后,重新启动VSCode,一切正常.
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
如果anaconda没有安装在默认目录中,请找到您自己的Anaconda3\Library\bin
.
If the anaconda was not installed in the default directory, please find your own Anaconda3\Library\bin
.
这篇关于NumPy库ImportError:DLL加载失败:找不到指定的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!