NumPy是一个定义了数值数组和矩阵类型和它们的基本运算的语言扩展。
SciPy是另一种使用NumPy来做高等数学、信号处理、优化、统计和许多其它科学任务的语言扩展。
Matplotlib是一个帮助绘图的语言扩展。
1)在Debian或Ubuntu中安装Matplotlib:
$sudo apt-get install Python-numpy
或者:
$sudo pip install numpy
2)在Fedora或CentOS/RHEL环境则可用如下命令:
$sudo yum install numpy
2.安装scipy
$sudo apt-get install libatlas-base-dev gfortran //这一步是后面安装scipy所必需的 ,避免scipy安装失败,确保所需库文 件
或者
$sudo apt-get install python-scipy
$sudo pip install scipy
3.安装matplotlib
1)可以通过如下命令在Debian或Ubuntu中安装Matplotlib:
$ sudo apt-get install python-matplotlib
或者
$sudo pip install matplotlib
2)在Fedora或CentOS/RHEL环境则可用如下命令:
$ sudo yum install python-matplotlib
注意:
使用pip会装到比较新的版本,而apt-get会比较旧。
如果提示你没有安装pip,可执行 sudo apt-get install python-pip进行安装
如果出错,可以试着执行sudo apt-get install build-essential python-dev
安装时需要用最新版的pip,更新pip: