import matplotlib._png fails

You should check your LD_LIBRARY_PATH environnment variable and check that your libpng is in it.

The problem reported by python is a problem of dynamic loading : Nothing to see with the recompilation of matplotlib.

So :

  1. Find the location of libpng.14.so with :

    $> locate libpng.14.so

    Note that the file must have the exact name so you may have to create a symbolic link if for example you have libpng.14.so.0 or something like that (Usually the symbolic links are automatically created when you install your lib

    If you don't have any libpng.14.so.something or libpng.14.so, you may need to reinstall libpng 1.4 (with your package manager or directly from the sources)

  2. Check $LD_LIBRARY_PATH. Change it if you need with :

    $> export LD_LIBRARY_PATH=anewDir:$LD_LIBRARY_PATH