Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1216034
  • 博文数量: 259
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 2518
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-13 16:12
个人简介

科技改变世界,技术改变人生。

文章分类

全部博文(259)

分类: Python/Ruby

2016-01-25 13:56:40

1、安装必要的包
yum install lapack lapack-devel blas blas-devel
yum install numpy
yum install scipy

如果没有安装gcc,要先安装gcc 和g++
yum install gcc  
yum install gcc-c++  

如果不安装lapack lapack-devel blas blas-devel 会报错(截取一部分):

lapack_opt_info:
  openblas_lapack_info:
    libraries openblas not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
    NOT AVAILABLE
  lapack_mkl_info:
  mkl_info:
    libraries mkl,vml,guide not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
    NOT AVAILABLE

warnings.warn(AtlasNotFoundError.__doc__)
  lapack_info:
    libraries lapack not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
    NOT AVAILABLE
...
...
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found


2、安装pip

下载pip


yum install -y openssl openssl-devel

python get-pip.py

[root@testserver4 ~]# python get-pip.py
Collecting pip
  Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 350kB/s
Collecting wheel
  Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)
    100% |████████████████████████████████| 65kB 5.0MB/s
Collecting argparse (from wheel)
  Downloading argparse-1.4.0-py2.py3-none-any.whl
Installing collected packages: pip, argparse, wheel
Successfully installed argparse-1.4.0 pip-7.1.2 wheel-0.26.0
/tmp/tmpcBdh5G/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.



输入pip命令如果能看到pip的介绍信息,那么证明安装成功了。

3、更新pip
pip install --upgrade pip

Scikit-learn要求
Scikit-learn requires:
    Python (>= 2.6 or >= 3.3),
    NumPy (>= 1.6.1),
    SciPy (>= 0.9).

4、升级numPy和scipy
pip install -U numPy
pip install -U scipy

5、安装sk-learn  
pip install -U scikit-learn

提示安装成功,那就可以开始scikit-learn之旅

基本上按照以上步骤都能安装好。


扩展:
指定版本安装
pip install scipy==0.16.1

python下如何安装.whl包?
pip install wheel
python下如何安装.whl包
之后pip install 包名字.whl 即可安装某模块包


参考:
http://www.centoscn.com/image-text/install/2014/0403/2715.html

http://blog.csdn.net/lingfeng892/article/details/50425547
阅读(3626) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~