Linux matplotlib 库装配 * The following required packages can not be built: * freetype, png

Linux matplotlib 库安装 * The following required packages can not be built: * freetype, png

Linux matplotlib 库装配 * The following required packages can not be built:   * freetype, png

我的百度云盘:可以下载文章所需软件包

http://pan.baidu.com/s/1jG3Vrts


1.解压matplotlib ,进入目录执行以下命令

sudo python setup.py install


返回信息:

* The following required packages can not be built:
                        * freetype, png


2.安装freetype

解压freetype,进入freetype目录,顺序执行如下命令

./configure

make

sudo make install

freetype安装成功



3.

python setup.py install

* The following required packages can not be built:
                        * png


4.安装libpng,

./configure

make

sudo make install


5.依赖zlib

./configure

make

sudo make install


安装zlib

搞定


import matplotlib.pyplot时,报错如下

ImportError: libpng16.so.16: cannot open shared object file

解决方案

http://blog.csdn.net/zybasjj/article/details/7577313

本人在/etc/ld.so.conf文件中加入一行

/usr/local/lib

执行如下命令

#sudo ldconfig

搞定