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

ubuntu下安装numpy,matplotlib

2015-08-20 16:59 603 查看
Ubuntu下安装numpy and matplotlib

安装numpy,命令如下:

sudo apt-get install python-numpy
sudo apt-get install python-scipy

安装matplotlib
第1步.需要先安装其依赖的包libpng和freetype
安装libpng:
sudo apt-get install libpng-dev
安装freetype:
先下载freetype,命令如下:

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz
然后解压:

tar zxvf freetype-2.4.10.tar.gz
然后进入freetype目录,安装freetype,命令如下:

cd freetype-2.4.10/
./congfigure
make
sudo make install

第2步.安装pip,然后通过pip来安装matplotlib:
sudo apt-get install python-pip

第3步.安装好pip后就可以用下面的命令来查找matplotlib和查看其安装状态
sudo pip search matplotlib
第4步.安装matplotlib
sudo pip install matplotlib

在终端进入python,输入

import numpy

import matplotlib

如果没报错就说明安装成功!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: