我在Windows 7(64位)上安裝Python 3.4以及sklearn python包[NumPy(> = 1.6.1),SciPy(> = 0.9)]。我從網上找到的匹配python 3.4的.whl文件安裝了Numpy和SciPy。我試圖通過調用pip install sklearn
來安裝sklearn包(僅供參考,我試圖在不使用Python(x.y)的情況下執行此安裝,因爲我需要python 3.x)。該pip install sklearn
命令將運行一段時間,但後來我得到以下錯誤:在Windows 7上從源代碼安裝Sklearn
copying sklearn\tests\__init__.py -> build\lib.win-amd64-3.4\sklearn\tests
running build_clib
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_clib
building 'libsvm-skl' library
compiling C sources
error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\jjaaae\\AppData\\Local\\Temp\\pip-build-43xaawp2\\scikit-learn\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\jjaaae\AppData\Local\Temp\pip-7i3ghuri-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\jjaaae\AppData\Local\Temp\pip-build-43xaawp2\scikit-learn\
我試圖安裝Microsoft Windows SDK 7.1,因爲它在錯誤消息描述。我也重新啓動了命令提示符和我的電腦,但仍然收到此錯誤消息。我錯過了什麼?
其他選項是爲windows安裝anaconda,它可以一次性安裝所有這些軟件包,無需任何麻煩:https://www.continuum.io/downloads –