dangom dangom - 1 year ago 226
Python Question

Matlplotlib with Qt backend on OS X -> Incompatible library versions

I'm having some problems with matplotlib's OS X native backend, namely that plot windows always pop up on the background.
I wanted therefore to try matplotlib's Qt backend, but when I try it I get the following error message:


ImportError:
dlopen(/Users/x/anaconda/lib/python2.7/site-packages/PyQt4/QtGui.so,
2): Library not loaded: @rpath/libpng16.16.dylib Referenced from:
/Users/x/anaconda/lib/libQtGui.4.8.7.dylib Reason:
Incompatible library version: libQtGui.4.dylib requires version 39.0.0
or later, but libpng16.16.dylib provides version 38.0.0


Does anyone know how to fix this?

Answer Source

If anyone ever comes across this problem, my solution was to:

brew uninstall libpng
brew cleanup && brew prune
brew install libpng

and

conda clean --all
conda update --all

Now matplotlib works fine with Qt backend.