[Module]matplotlib模块安装

来源:互联网 发布:淘宝拍照灯光 编辑:程序博客网 时间:2024/06/05 06:29

简述

python code中有import matplotlib,但是使用的Ubuntu 16.04 64bit上的python3.5没有这个module,需要进行安装。

安装

使用如下命令开始安装:

pip3 install matplotlib

发现提示如下:

freetype: no  [The C/C++ header for freetype2 (ft2build.h) could not be found.  You may need to install the development package.]png: no  [pkg-config information for 'libpng' could not be found.]* The following required packages can not be built:                            * freetype, png

说明缺少依赖的包freetype和libpng。

安装libpng

使用如下命令:

sudo apt-get install libpng-dev

安装freetype

cd ~/Downloadswget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.5.tar.gztar -zxvf freetype-2.6.5.tar.gzcd freetype-2.6.5/./congfiguresudo makesudo make install

继续安装matplotlib

再用命令:

sudo pip3 install matplotlib

发现终端卡住了……
需要耐心等待,过了十来分钟后,看到pip还安装了其他的缺少的东西,并将matplotlib安装完成:
这里写图片描述

0 0
原创粉丝点击