2016-11-01 31 views
0

我在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,因爲它在錯誤消息描述。我也重新啓動了命令提示符和我的電腦,但仍然收到此錯誤消息。我錯過了什麼?

+0

其他選項是爲windows安裝anaconda,它可以一次性安裝所有這些軟件包,無需任何麻煩:https://www.continuum.io/downloads –

回答

0

我發現了這個問題。即使您尚未安裝.Net 4.x,Microsoft Windows SDK 7.1的下載文件也允許您「安裝」該文件。在安裝過程中,我一定很高興,並且錯過了這個警告。所以SDK 7.1的安裝非常快,並沒有安裝我需要的東西。當我備份時,首先從this URL安裝Microsoft .NET Framework 4,然後按照它的指示安裝SDK 7.1。