fatal error: png.h: no such file or directory
source : http://stackoverflow.com/questions/9829175/pip-install-matplotlib-error-with-virtualenv
Building Matplotlib requires libpng (and freetype, as well) which isn't a python library, so pipdoesn't handle installing it (or freetype).
You'll need to install something along the lines of libpng-devel and freetype-devel (or whatever the equivalent is for your OS).
See the building requirements/instructions for matplotlib.
To generate graph in png format you need to Install following dependent packages
sudo apt-get install libpng-dev
sudo apt-get install libfreetype6-dev
浙公网安备 33010602011771号