windows10安装配置scikit-learn步骤

时间:2021-07-10 19:36:56

安装python-2.7.13.msi(到C:\Python27),把C:\Python27和C:\Python27\Scripts添加到系统环境变量

windows10安装配置scikit-learn步骤

安装numpy:下载numpy-1.11.3+mkl-cp27-cp27m-win32.whl

windows10安装配置scikit-learn步骤

mkl即intel的math kernel lib

注:如果网速好,也可以用命令 pip install numpy。后面几个包类似

安装scipy:下载scipy-0.19.0-cp27-cp27m-win32.whl

windows10安装配置scikit-learn步骤

安装matplotlib:下载matplotlib-1.5.3-cp27-cp27m-win32.whl

windows10安装配置scikit-learn步骤

pip安装sklearn

windows10安装配置scikit-learn步骤

所需包均安装完毕。查看其安装路径

windows10安装配置scikit-learn步骤

测试sklearn是否正常工作

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

输出

[[ 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/