2017-06-14 387 views
2

我在使用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. 
+0

確保使用Python ** 3.6.1 **。請參閱[Python issue#29943](https://bugs.python.org/issue29943) – cgohlke

回答

-1

要短:

嘗試將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手動

+0

您安裝了哪個'whl'軟件包以及哪個版本的Python? Python 3.6還是Python 2.7? –

+0

@ HoangV.Pham現在我使用Python 2.7 –

1

最新版本好像壞了。安裝舊版本:

pip3 uninstall numpy 
pip3 install 'numpy<1.13' 
相關問題