windows10安裝配置scikit-learn步驟

安裝python-2.7.13.msi(到C:\Python27),把C:\Python27和C:\Python27\Scripts添加到系統環境變量python

 

安裝numpy:下載numpy-1.11.3+mkl-cp27-cp27m-win32.whlgit

mkl即intel的math kernel lib測試

注:若是網速好,也能夠用命令 pip install numpy。後面幾個包相似spa

 

安裝scipy:下載scipy-0.19.0-cp27-cp27m-win32.whlcode

 

 

安裝matplotlib:下載matplotlib-1.5.3-cp27-cp27m-win32.whlblog

 

 

pip安裝sklearnip

 

所需包均安裝完畢。查看其安裝路徑ci

 

測試sklearn是否正常工做it

from sklearn import datasets
iris = datasets.load_iris()
digits = datasets.load_digits()

print digits.data

輸出pip

[[ 0. 0. 5. ..., 0. 0. 0.]
[ 0. 0. 0. ..., 10. 0. 0.]
[ 0. 0. 0. ..., 16. 9. 0.]
...,
[ 0. 0. 1. ..., 6. 0. 0.]
[ 0. 0. 2. ..., 12. 0. 0.]
[ 0. 0. 10. ..., 12. 1. 0.]]

 

表示sklearn已正確安裝,能夠工做。 

 

 注:Python各類擴展包安裝腳本下載:http://www.lfd.uci.edu/~gohlke/pythonlibs/

相關文章
相關標籤/搜索