您的位置:首页 > 编程语言 > Python开发

liunx 环境下 python模块numpy,scipy,matplotlib 安装

2017-08-10 10:33 921 查看
NumPy是一个定义了数值数组和矩阵类型和它们的基本运算的语言扩展。

SciPy是另一种使用NumPy来做高等数学、信号处理、优化、统计和许多其它科学任务的语言扩展。

Matplotlib是一个帮助绘图的语言扩展。

1.首先安装Numpy,它是matplotlib的先行包,里面的很多图形处理函数都要依赖numpy里的数学计算。

  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:
$sudo pip install --upgrade pip
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐