You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me, installing mpl on OSX from source required tinkering with homebrew. This is a note to self to make a more detailed report of the issue and an invitation to other OSX users to report installation difficulties. There seems to be fairly widespread problem.
I think this issue arises when you try to pip install matplotlib (or development matplotlib from github) into a conda environment. In all other cases I know of, conda and pip get along fine; conda is meant to be supplemented by pip. But I have seen this combo fail on three separate Macs.
I install matplotlib on OS X using a Gentoo prefix install. Everything seems to work ok. The only problem I've encountered so far is that when I try to save something to a file, I can't change the filename on the dialog box, because the keyboard strokes go to the terminal where I am running python. I don't know if this is a matplotlib issue or a issue in tkinter from Python, but matplotlib is the only place where I have this problem.
Upgrading to 1.4 through conda did work fine (although I simultaneously deleted my matplotlib font cache – not very good science!), but I'm unable to install matplotlib through pip. I don't use homebrew, though. My understanding was that unless you use homebrew for everything it causes more trouble than it's worth, but perhaps this is outdated advice.
Here's a recipe of my attempt to install matplotlib in a clean conda environment:
It looks like you don't have libpng installed (at least not with pkgconfig) or you have it installed in a non-standard directory.
For some reason, matplotlib setup check seems to always assume libpng is installed instead of really checking for it which is why it gets all the way to building the _png extension before erroring out.
(pip_matplotlib)[~]$ otool -L /Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so:
libpng15.15.dylib (compatibility version 29.0.0, current version 29.0.0)
libz.1.dylib (compatibility version 1.0.0, current version 1.2.7)
/usr/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.17.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0)
(pip_matplotlib)[~]$ pkg-config libpng --libs
-bash: pkg-config: command not found
export DYLD_LIBRARY_PATH=/Users/mwaskom/anaconda/envs/pip_matplotlib/lib before you run anything that way the dynamic linker knows where to load the libpng library from
Install libpng at the system level (not in a user directory)
A more involved approach which is what the maintainers for anaconda do (I presume) is to adjust the linker flags when building each package so that when the linker builds each executable or shared library, it sets the dynamic library load commands to @loader_path relative. By doing so, they will pick up only the libraries they have installed in their own lib directory and not get any accidental loading of system libraries in /usr/lib, usr/local/lib, etc.
Activity
jenshnielsen commentedon Aug 26, 2014
pip install matplotlibjust works for me without any issues and has for a long time. All dependencies installed from Homebrew.I would like some more details about which issues you are seeing.
cimarronm commentedon Aug 26, 2014
Same as @jenshnielsen. I Install/work from the source all the time on OSX and never had to tweak any of my dependencies installed from homebrew.
@danielballan You should send your build logs when you can
danielballan commentedon Aug 27, 2014
I think this issue arises when you try to
pip install matplotlib(or development matplotlib from github) into a conda environment. In all other cases I know of, conda and pip get along fine; conda is meant to be supplemented by pip. But I have seen this combo fail on three separate Macs.I will reproduce and share my build logs soon.
jenshnielsen commentedon Aug 27, 2014
Ok that is useful to know. I don't have conda installed but perhaps I should setup an environment to test
There was some talk about integrating the conda mpl script into matplotlib at scipy this year see #3311
amadio commentedon Aug 28, 2014
I install matplotlib on OS X using a Gentoo prefix install. Everything seems to work ok. The only problem I've encountered so far is that when I try to save something to a file, I can't change the filename on the dialog box, because the keyboard strokes go to the terminal where I am running python. I don't know if this is a matplotlib issue or a issue in tkinter from Python, but matplotlib is the only place where I have this problem.
tacaswell commentedon Aug 28, 2014
@amadio Can you create a new issue for the key-stroke problem? That is definitely a run-time not install-time issue.
tacaswell commentedon Sep 5, 2014
@danielballan @mwaskom Any word on tracking this down? It sounds like this was isolated on macs using conda and they are now shipping 1.4.0 binaries.
Closing for now, ping me if this needs to be re-opened.
mwaskom commentedon Sep 5, 2014
Upgrading to 1.4 through conda did work fine (although I simultaneously deleted my matplotlib font cache – not very good science!), but I'm unable to install matplotlib through pip. I don't use homebrew, though. My understanding was that unless you use homebrew for everything it causes more trouble than it's worth, but perhaps this is outdated advice.
Here's a recipe of my attempt to install matplotlib in a clean conda environment:
And here is the resulting log.
cimarronm commentedon Sep 5, 2014
It looks like you don't have libpng installed (at least not with pkgconfig) or you have it installed in a non-standard directory.
For some reason, matplotlib setup check seems to always assume libpng is installed instead of really checking for it which is why it gets all the way to building the _png extension before erroring out.
mwaskom commentedon Sep 5, 2014
Ok so I did
conda install libpngand thenpip install matplotlibworked, but:cimarronm commentedon Sep 5, 2014
What does
otool -L /Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.soandpkg-config libpng --libsshow?mwaskom commentedon Sep 5, 2014
(pip_matplotlib)[~]$ otool -L /Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so /Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so: libpng15.15.dylib (compatibility version 29.0.0, current version 29.0.0) libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.17.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0) (pip_matplotlib)[~]$ pkg-config libpng --libs -bash: pkg-config: command not foundcimarronm commentedon Sep 5, 2014
I think you have two options here:
export DYLD_LIBRARY_PATH=/Users/mwaskom/anaconda/envs/pip_matplotlib/libbefore you run anything that way the dynamic linker knows where to load the libpng library fromA more involved approach which is what the maintainers for anaconda do (I presume) is to adjust the linker flags when building each package so that when the linker builds each executable or shared library, it sets the dynamic library load commands to @loader_path relative. By doing so, they will pick up only the libraries they have installed in their own lib directory and not get any accidental loading of system libraries in /usr/lib, usr/local/lib, etc.