当我尝试运行时(在Windows 10上):
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 :(得分:0)
我认为您需要在PATH中安装cl.exe。
cl.exe应位于您的(visual studio文件夹)\ VC \ bin
下答案 1 :(得分:0)
试试这个:
cmd
pip install <filename>.whl
并按Enter