fatal error: png.h: no such file or directory

时间:2022-04-02 01:31:48

source : http://*.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