2017-06-20 104 views
0

我正在嘗試使用pandas python進行excel操作。使用numpy時出錯

每當我嘗試使用熊貓庫,它會給我錯誤,說numpy不安裝。

現在,當我嘗試做PIP安裝numpy的PIP安裝熊貓,它說,需求已經滿足。

但是,當我嘗試做一個簡單的numpy教程,它在numpy的導入語句上出錯。

> import numpy as np 
>Traceback (most recent call last): 
> File "C:\Users\user\AppData\Local\Programs\Python\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 "<stdin>", line 1, in <module> 
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\__init__.py", line 142, in <module> 
> from . import add_newdocs 
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\add_newdocs.py", line 13, in <module> 
> from numpy.lib import add_newdoc 
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\__init__.py", line 8, in <module> 
> from .type_check import * 
> File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\type_check.py", line 11, in <module> 
> import numpy.core.numeric as _nx 
> File "C:\Users\user\AppData\Local\Programs\Python\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.*** 
+2

看起來你的NumPy安裝在某種程度上被破壞了。也許用'pip install --force-reinstall numpy'強制重新安裝軟件包,然後重試。 – jdehesa

+0

我已經嘗試過,但我仍然收到錯誤。當我執行重新安裝時,我注意到在安裝時說它正在使用緩存的numpy庫。我會嘗試獲得numpy輪子並手動安裝。參考:從第二回答https://stackoverflow.com/questions/29499815/how-to-install-numpy-on-windows-using-pip-install –

+0

這個答案是從這個線程,由Panic上校回答。 https://stackoverflow.com/questions/29499815/how-to-install-numpy-on-windows-using-pip-install –

回答

0

嘗試pip install --upgrade --force-reinstall numpy 你應該嘗試在正確的目錄壽。

+0

甜蜜的感謝。那個正確的目錄在哪裏?它位於:C:\ Users \ user \ AppData \ Local \ Programs \ Python \ Python36 \ lib \ site-packages? –

+0

它應該位於Python文件夾的腳本目錄中。例如我的是「C:\ Python27 \ Scripts」 –