我已經安裝了python 3.6並通過pip添加了numpy模塊,但在嘗試導入庫時出現錯誤。請在這裏幫助:無法在Python中導入numpy庫
>>> import numpy
Traceback (most recent call last):
File "C:\Users\as338011\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.
在處理上述異常,另一個異常:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\as338011\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\__init__.py", line 142, in <mod
ule>
from . import add_newdocs
File "C:\Users\as338011\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\add_newdocs.py", line 13, in <m
odule>
from numpy.lib import add_newdoc
File "C:\Users\as338011\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\__init__.py", line 8, in <m
odule>
from .type_check import *
File "C:\Users\as338011\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\as338011\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.
原來的錯誤是:DLL加載失敗:指定的程序無法找到。
你試過卸載然後重新安裝numpy嗎? – DavidG
我試過多次通過pip重新安裝,而嘗試用pip3我得到以下錯誤: 'PS E:\機器學習分類器> python pip3安裝numpy C:\ Users \ as338011 \ AppData \ Local \ Programs \ Python \ Python36 \ python.exe:無法打開文件'pip3':[Errno 2]沒有這樣的文件或目錄' – Ashutosh