2017-04-04 168 views
1

當我嘗試(在Windows 10)運行:錯誤而安裝sklearn

pip install sklearn 

我得到

copying sklearn\tests\test_pipeline.py -> build\lib.win-amd64-3.6\sklearn\tests 
    copying sklearn\tests\test_random_projection.py -> build\lib.win-amd64-3.6\sklearn\tests 
    copying sklearn\tests\__init__.py -> build\lib.win-amd64-3.6\sklearn\tests 
    running build_clib 
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils 
    customize MSVCCompiler 
    Missing compiler_cxx fix for MSVCCompiler 
    customize MSVCCompiler using build_clib 
    building 'libsvm-skl' library 
    compiling C sources 
    creating build\temp.win-amd64-3.6 
    creating build\temp.win-amd64-3.6\sklearn 
    creating build\temp.win-amd64-3.6\sklearn\svm 
    creating build\temp.win-amd64-3.6\sklearn\svm\src 
    creating build\temp.win-amd64-3.6\sklearn\svm\src\libsvm 
    cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I"c:\program files\python\lib\site-packages\numpy\core\include" /EHsc /Tpsklearn\svm\src\libsvm\libsvm_template.cpp /Fobuild\temp.win-amd64-3.6\sklearn\svm\src\libsvm\libsvm_template.obj 
    Could not locate executable cl.exe 
    Executable cl.exe does not exist 

    error: Command "cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I"c:\program files\python\lib\site-packages\numpy\core\include" /EHsc /Tpsklearn\svm\src\libsvm\libsvm_template.cpp /Fobuild\temp.win-amd64-3.6\sklearn\svm\src\libsvm\libsvm_template.obj" failed with exit status 1 

    ---------------------------------------- 
Command ""c:\program files\python\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\$andu\\AppData\\Local\\Temp\\pip-build-cho6u5yy\\scikit-learn\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\$andu\AppData\Local\Temp\pip-977em_sb-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\$andu\AppData\Local\Temp\pip-build-cho6u5yy\scikit-learn\ 

沒有發現的建議在網上爲我工作的一個長長的清單。

我該如何處理?


我有numpy-1.12.1+mkl-cp36-cp36m-win_amd64.whl和安裝scipy-0.19.0-cp36-cp36m-win_amd64.whl

回答

0

我認爲你需要在你的PATH中有cl.exe。

cl.exe時應該是你的(視覺工作室文件夾)下的\ VC \ BIN

+0

您sugg estion不起作用 –

0

試試這個:

  1. 轉到您放置在車輪文件
  2. 單擊Windows資源管理器的位置地址欄和類型cmd
  3. 類型pip install <filename>.whl,然後按回車
+0

按照您的建議,我從https://pypi.python.org/pypi下載scikit_learn-0.18.1-cp36-cp36m-manylinux1_i686.whl和scikit_learn-0.18.1-cp36-cp36m-manylinux1_x86_64.whl /scikit-learn/0.18.1#downloads。我嘗試安裝它們,但仍然出現錯誤: scikit_learn-0.18.1-cp36-cp36m-manylinux1_x86_64.whl在此平臺上不受支持。 –

+0

當我下載它們時,我看着py版本。win文件(cp35)給出同樣的錯誤。我應該理解win32文件cp36還沒有提供嗎? –

+0

你說你使用的是Windows 10,對吧?該輪盤文件適用於Linux。查看文件名以選擇正確的車輪文件。如果您有64位處理器,您可能需要一個用於win_amd64。還要確保該文件與您的Python版本對齊。 –