Matplotlib appears not to be installing correctly; issues with "_png.so" file.
Closed this issue · 11 comments
I'm running Python 2.7.2 on a Macbook Air with Mountain Lion 10.8.1. I haven't installed any other packages.
The first time I installed the ScipySuperpack, I did it using the download of the 'install_superpack.sh' master. I, stupidly, didn't have the command line tools installed, so I deleted all the packages from /Library/Python/2.7/site-packages
, installed the command line tools, and cloned the project to my computer. I then ran install_superpack.sh
and chose the 'cloned repository' option.
The installation seemed to install everything fine, and matplotlib reported:
creating /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg
Extracting matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg to /Library/Python/2.7/site-packages
matplotlib 1.2.x is already the active version in easy-install.pth
Installed /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg
However, from Python, executing import pylab as pl
yielded the following error:
import matplotlib._png as _png
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/_png.so, 2): Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/_png.so
Reason: image not found
Also, running the command ipython -pylab
yields an error:
ImportError: dlopen(/Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/_png.so, 2): Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /Library/Python/2.7/site-packages/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg/matplotlib/_png.so
Reason: image not found
So, I then tried downloading matplotlib directly and reinstalling using the command, sudo python setup.py install
however that yielded the same operating results. However, my 'site-packages' folder now contains both a 'matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg' folder and a 'matplotlib' folder.
Not sure how to proceeded, nor do I really know where the problem lies. Thoughts?
OK, this one is my fault. I didn't build it statically against libpng. Go ahead and delete the matplotlib from your site-packages and try running:
sudo easy_install -N -Z https://raw.github.com/fonnesbeck/ScipySuperpack/master/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg
Let me know how you fare.
I have the same issue. I got 403 error with the command.
error: Can't download https://raw.github.com/fonnesbeck/ScipySuperpack/master/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg: 403 Forbidden
I did a full clone of the repository and ran sudo easy_install -N -Z matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg
. The errors I previously had aren't happening now! Whee. Thanks.
@yy You can try this instead:
sudo easy_install -N -Z https://dl.dropbox.com/u/233041/matplotlib-1.2.x-py2.7-macosx-10.8-intel.egg
This same issue occurs on Mac OS X 10.6 with matplotlib 1.2.1.
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_png.so
Reason: image not found
What do you recommend for older computer users like me?
You might try the Enthought Python Distribution. I believe they have a version for 10.6.8, and it would include the scientific packages.
That seems like it'd be a good idea for the future. I tried downloading the Enthought distro, but now is there an easy way to direct python to look for the packages in Enthought for use from the terminal? Unless I'm running code from within Enthought software I don't have access to those packages.
Yes, when you have multiple versions of Python installed, you need to know which is used when you call python
from the command line.
Check your ENV to see where Enthought puts Python on your path. You can always move it to the front of the path so that it is called when you type python
at the command line.
You might also check out Canopy
Thanks @fonnesbeck , that helps. Not sure if I'll stick with using it forever, it would be great if there were a more general solution for OS X users.
Understandable. The goal of this project is to provide builds of the most recent core scientific computing packages for the Python in the currently-shipping version of OS X. I'd like to provide for a wider audience, but its just not feasible for me to do so.