2017-06-16 43 views
0

我試圖通過運行安裝Scikit:Scikit安裝詢問SciPy的,即使它是安裝

pip install scikit-learn 

當我運行它,我得到這個消息:

Collecting scikit-learn 
    Using cached scikit-learn-0.18.1.tar.gz 
Installing collected packages: scikit-learn 
    Running setup.py install for scikit-learn ... error 
    Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-build-3080ikpy\\scikit-learn\\setup.py';f=getatt 
r(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER\AppData\Local\Temp\pip-04zx4iu6-record\i 
nstall-record.txt --single-version-externally-managed --compile: 
    Partial import of sklearn during the build process. 
    Traceback (most recent call last): 
     File "C:\Users\USER\AppData\Local\Temp\pip-build-3080ikpy\scikit-learn\setup.py", line 149, in get_scipy_status 
     import scipy 
     File "c:\python36\lib\site-packages\scipy\__init__.py", line 61, in <module> 
     from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl 
    ImportError: cannot import name 'NUMPY_MKL' 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "C:\Users\USER\AppData\Local\Temp\pip-build-3080ikpy\scikit-learn\setup.py", line 270, in <module> 
     setup_package() 
     File "C:\Users\USER\AppData\Local\Temp\pip-build-3080ikpy\scikit-learn\setup.py", line 260, in setup_package 
     .format(scipy_req_str, instructions)) 
    ImportError: Scientific Python (SciPy) is not installed. 
    scikit-learn requires SciPy >= 0.9. 
    Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html 

這似乎問我安裝SciPy的,但是我已經安裝SciPy的,而事實上,如果我跑

pip install scipy 

我得到

Requirement already satisfied: scipy in c:\python36\lib\site-packages 
Requirement already satisfied: numpy>=1.8.2 in c:\python36\lib\site-packages (from scipy) 
+0

你安裝了什麼版本的scipy? –

+0

我有版本0.19 32位 – Nadni

+0

你的機器上已經安裝了numpy和mkl嗎?然後你會嘗試安裝scipy。獲得Scipy生態系統工作的最簡單方法可能是收集所有那些包:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy – tagoma

回答

2

你安裝顯示了這個:from numpy._distributor_init import NUMPY_MKL # requires numpy+mklImportError: cannot import name 'NUMPY_MKL'

所以,你需要做幾件事。得到正確的SciPy的:http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

得到正確的NumPy的:http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

得到正確的SciKit瞭解:http://www.lfd.uci.edu/~gohlke/pythonlibs/#sci-kitlearn

現在做各pip uninstall的其他包。然後在您提供的鏈接處下載pip install輪圈 - NumPy 1st,SciPy 2nd,然後是Ski-kitlearn last。那應該可以解決你的問題。請注意,根據您是否安裝了32位或64位Python,您正在使用cp36‑cp36m‑win32.whlcp36‑cp36m‑win_amd64.whl下載文件。