一、安装numpy
下载numpy源码并解压。
wget http://jaist.dl.sourceforge.NET/project/numpy/NumPy/1.9.0/numpy-1.9.0.zip
安装numpy。
[root]# unzip numpy-1.9.0.zip
[root]# cd numpy-1.9.0
[root]# python setup.py install
安装完毕后,重启 。
[root]# reboot
[myhaspl@localhost~]$ python
Python2.7.5 (default,Jun 17 2014,18:11:42)
[GCC4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type"help","copyright","credits" or"license" for more information.
>>>import numpy as np
>>>
二、安装Scipy在使用 pip install scikit-learn 时报错,是安装依赖包scipy出错。
经过stack overflow查询,需要先运行
yum install blas-devel lapack-devel
wget https://github.com/scipy/scipy/releases/download/v0.17.0/scipy-0.17.0.zip
同上一样安装(注意python版本的兼容性)
三、
# pip install scikit-learn
Collecting scikit-learn Downloading http://mirrors.aliyun.com/pypi/packages/f1/dc/5fb2834511eef6f86e17b6ec41c0c7a60733f79633827e75aaa55029a9fa/scikit-learn-0.18.1.tar.gz (8.9MB) 100% |████████████████████████████████| 8.9MB 63.6MB/s Installing collected packages: scikit-learn Running setup.py install for scikit-learn ... done Successfully installed scikit-learn-0.18.1