New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify difficulties installing mpl on OSX. #3416
Comments
I would like some more details about which issues you are seeing. |
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 |
I think this issue arises when you try to I will reproduce and share my build logs soon. |
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 |
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. |
@amadio Can you create a new issue for the key-stroke problem? That is definitely a run-time not install-time issue. |
@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. |
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. |
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. |
Ok so I did (pip_matplotlib)[~]$ ipython [mwaskom]|1> import matplotlib
[mwaskom]|2> import matplotlib.pyplot
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-6f467123fe04> in <module>()
----> 1 import matplotlib.pyplot
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
25
26 import matplotlib
---> 27 import matplotlib.colorbar
28 from matplotlib import style
29 from matplotlib import _pylab_helpers, interactive
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/colorbar.py in <module>()
32 import matplotlib.artist as martist
33 import matplotlib.cbook as cbook
---> 34 import matplotlib.collections as collections
35 import matplotlib.colors as colors
36 import matplotlib.contour as contour
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/collections.py in <module>()
25 import matplotlib.artist as artist
26 from matplotlib.artist import allow_rasterization
---> 27 import matplotlib.backend_bases as backend_bases
28 import matplotlib.path as mpath
29 from matplotlib import _path
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/backend_bases.py in <module>()
54
55 import matplotlib.tight_bbox as tight_bbox
---> 56 import matplotlib.textpath as textpath
57 from matplotlib.path import Path
58 from matplotlib.cbook import mplDeprecation
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/textpath.py in <module>()
20 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
21 from matplotlib.ft2font import LOAD_TARGET_LIGHT
---> 22 from matplotlib.mathtext import MathTextParser
23 import matplotlib.dviread as dviread
24 from matplotlib.font_manager import FontProperties
/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/mathtext.py in <module>()
61
62 import matplotlib.colors as mcolors
---> 63 import matplotlib._png as _png
64 ####################
65
ImportError: dlopen(/Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: libpng15.15.dylib
Referenced from: /Users/mwaskom/anaconda/envs/pip_matplotlib/lib/python2.7/site-packages/matplotlib/_png.so
Reason: image not found |
What does |
(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 |
I think you have two options here:
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. |
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.
The text was updated successfully, but these errors were encountered: