Incorrect linking of libpng for python3

0 views
Skip to first unread message

Simon Walker

unread,
May 26, 2015, 4:43:08 AM5/26/15
to co...@continuum.io
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

Katy Huff

unread,
Jun 15, 2015, 7:00:25 PM6/15/15
to co...@continuum.io
I just ran into this same error. 
... FWIW ...

Carlos Córdoba

unread,
Jun 15, 2015, 11:34:54 PM6/15/15
to co...@continuum.io
Hi,

Running

    conda update qt
    conda update matplotlib

should fix the problem.


Cheers,
Carlos

El 15/06/15 a las 18:00, Katy Huff escribió:
--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/conda/.

Katy Huff

unread,
Jun 15, 2015, 11:44:07 PM6/15/15
to Carlos Córdoba, co...@continuum.io
Ah! I hadn't though to update qt! That worked! 
Thanks, 
Katy

Carlos Córdoba

unread,
Jun 15, 2015, 11:47:50 PM6/15/15
to Katy Huff, co...@continuum.io
You're welcome! :-)

El 15/06/15 a las 22:43, Katy Huff escribió:
Reply all
Reply to author
Forward
0 new messages