NumPy库导入错误:DLL加载失败:无法找到指定的程序
我在使用Windows 10上的Visual Studio 2017学习python。当我试图将NumPy库导入到我的代码中时,出现此错误。我曾尝试卸载并重新安装,在ImportError: DLL load failed when importing Numpy installed in conda virtual environment的每条指令中查找libiomp5md.dll
,但以no为准。NumPy库导入错误:DLL加载失败:无法找到指定的程序
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.
要短:
尝试将Python环境切换到Python 2.7,它可以解决这个问题。
我也有同样的问题。 我注意到你使用Python 3.6(以前,我也使用Python 3.6)。 而我使用Python 2.7后,它解决了我的问题。
我想用numpy & scipy库和VS2017给我带来了很多错误! 我做了一些搜索之后,我通过安装whl
包来解决所有问题http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy手动
您安装了哪个'whl'软件包以及哪个版本的Python? Python 3.6还是Python 2.7? –
@ HoangV.Pham现在我使用Python 2.7 –
最新版本好像坏了。安装旧版本:
pip3 uninstall numpy
pip3 install 'numpy<1.13'
确保使用Python ** 3.6.1 **。请参阅[Python issue#29943](https://bugs.python.org/issue29943) – cgohlke