官方文档:http://scikit-learn.org/stable/install.html
Scikit-learn requires:
• Python (>= 2.6 or >= 3.3),
• NumPy (>= 1.6.1),
• SciPy (>= 0.9).
使用的环境是python3.4
安装Scipy时报错 出现NOT AVAILABLE错误 查看错误代码后发现应该先安装Numpy
安装Numpy时较为顺利,直接pip install numpy 等待安装完成
接着重新安装Scipy,pip install scipy 安装成功

环境准备就绪 安装scikit-learn
直接pip install scikit-learn 出现unable to find vcvarsall.bat
看来又是vc编译的问题….(SET VS90COMNTOOLS=%VS120COMNTOOLS%)
查阅后发现方法一:安装MinGW

  1. 首先安装MinGW,在MinGW的安装目录下找到bin的文件夹,找到 mingw32-make.exe,复制一份更名为make.exe;
  2. 把MinGW的路径添加到环境变量path中,比如我把MinGW安装到D: \MinGW\中,就把D:\MinGW\bin添加到path中;
  3. 打开命令行窗口,在命令行窗口中进入到要安装代码的目录下;
  4. 输入如下命令就可以安装了。
  5. setup.py install build –compiler=mingw32

然而尝试后以失败告终。。

接着搜索在知乎上看到了pip install lxml失败报同样错误的问题
http://www.zhihu.com/question/26857761)
发现方法二:
将Python34/Lib/distutils/msvc9compiler.py文件中的
vc_env = query_vcvarsall(VERSION, plat_spec)
为:
如果安装的是VS2014,则VERSION为13.0;
如果安装的是VS2013,则VERSION为12.0;
如果安装的是VS2012,则VERSION为11.0;
如果安装的是VS2010,则VERSION为10.0;
如果安装的是VS2008,则VERSION为9.0。
像我的安装的是VS2013,则
vc_env = query_vcvarsall(12.0, plat_spec)

接着重新pip安装 成功

在python中import sklearn发现报错!

1.    >>> import sklearn  
2.    Traceback (most recent call last):  
3.      File "<stdin>", line 1, in <module>  
4.      File "sklearn/__init__.py", line 37, in <module>  
5.    from . import __check_build  
6.      File "sklearn/__check_build/__init__.py", line 46, in <module>  
7.    raise_build_error(e)  
8.      File "sklearn/__check_build/__init__.py", line 41, in raise_build_error  
9.    %s""" % (e, local_dir, ''.join(dir_content).strip(), msg))  
10.    ImportError: No module named _check_build  
11.    ___________________________________________________________________________  
12.    Contents of sklearn/__check_build:  
13.    __init__.py   __init__.pyc  _check_build.c  
14.    _check_build.pyx  setup.py  setup.pyc  
15.    ___________________________________________________________________________  
16.    It seems that scikit-learn has not been built correctly.  
17.      
18.    If you have installed scikit-learn from source, please do not forget  
19.    to build the package before using it: run `python setup.py install` or  
20.    `make` in the source directory.  
21.      
22.    If you have used an installer, please check that it is suited for your  
23.    Python version, your operating system and your platform.  

后来发现可能是编译器没有重启 把命令提示行全关闭后重新import sklearn 成功