From: Christopher Fonnesbeck <fonnesbeck@ma...> - 2008-01-14 01:26:39
On some OSX systems, pylab is failing on importing pylab because of
lack of GTK. This appears to be a bug; if the system doesnt have gtk,
it should simply not import that backend to begin with.
>>> from matplotlib import pylab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
macosx-10.5-i386.egg/matplotlib/pylab.py", line 292, in <module>
from matplotlib.pyplot import *
macosx-10.5-i386.egg/matplotlib/pyplot.py", line 39, in <module>
new_figure_manager, draw_if_interactive, show = pylab_setup()
macosx-10.5-i386.egg/matplotlib/backends/__init__.py", line 24, in
macosx-10.5-i386.egg/matplotlib/backends/backend_gtkagg.py", line 10,
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
macosx-10.5-i386.egg/matplotlib/backends/backend_gtk.py", line 6, in
ImportError: No module named gobject
From: John Hunter <jdh2358@gm...> - 2008-01-16 21:38:26
On Jan 13, 2008 7:26 PM, Christopher Fonnesbeck <fonnesbeck@...> wrote:
> On some OSX systems, pylab is failing on importing pylab because of
> lack of GTK. This appears to be a bug; if the system doesnt have gtk,
> it should simply not import that backend to begin with.
matplotlib does not do runtime checking to see if a backend is
available (arguably it should, but it does not_. It does do compile
time checking, and if gtk was available at compile time it will spit
out a default matplotlib rc file which uses gtkagg. If you ship this
to your users who do not have gtk, it can cause problems (you can
tweak this with setup.cfg).
You may want to make tkagg the default backend if you are distributing
binaries, since it is most likely to work on the user side.