Hi,
I'm not sure where to report this, I don't know if it's a conda issue or matplotlib issue, but I'm finding the matplotlib._png.so file is incorrectly linked when using python3 on OSX.
When I use python 2 to run the example code below, I get no errors. When I use python 3 I find the following:
ImportError: dlopen(/Users/simon/anaconda/envs/python3/lib/python3.4/site-packages/matplotlib/_png.so, 2): Library not loaded: libpng15.15.dylib
Referenced from: /Users/simon/anaconda/envs/python3/lib/python3.4/site-packages/matplotlib/_png.so
Reason: image not found
When I use otool -L I see for python2:
$ otool -L ~/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/_png.so
/Users/simon/anaconda/envs/python2/lib/python2.7/site-packages/matplotlib/_png.so:
@loader_path/../../../libpng15.15.dylib (compatibility version 29.0.0, current version 29.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1094.0.0)
i.e the relative path of the libpng shared library is hard coded into the loader path. For python 3:
$ otool -L ~/anaconda/envs/python3/lib/python3.4/site-packages/matplotlib/_png.so
/Users/simon/anaconda/envs/python3/lib/python3.4/site-packages/matplotlib/_png.so:
libpng15.15.dylib (compatibility version 29.0.0, current version 29.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 283.0.0)
it's expected to be unspecified but available. At some point the loader path gets set when compiling _png.so and it looks like it's happening for python 2 but not python 3. The test code is just a simple plot to show this error.
$ source activate python3
(python3) $ python -c 'import matplotlib.pyplot as plt'
Thanks,
Simon