For python 2.7
apt-get install python-dev
apt-get install aptitude
aptitude install python-dev
apt-get install python-pip
For python 3.5
apt-get install python3-pip python3-dev
下面以3.5为例下载各种库,2.7作对应修改
现在用pip安装用于数值计算和绘图的包 分别是numpy scipy matplotlib pandas
sudo pip3 install numpy
sudo pip3 install scipy
sudo pip3 install matplotlib
sudo pip3 install pandas
最后在用pip安装 sklearn
sudo pip3 install -U scikit-learn
测试下是否全部安装成功,打开python解释器,输入以下命令,若无报错,则就成功。
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets,linear_model