On Thursday 11 January 2007 16:12, Darren Dale wrote: > $ ipython > > In [1]: __import__('matplotlib.backends.backend_ps', globals(),\ > locals(),['backend_ps']) > > output: > --------------------------------------------------------------------------- > exceptions.AttributeError Traceback (most recent > call last) > > /home/darren/<ipython console> > > /usr/lib64/python2.4/site-packages/matplotlib/backends/__init__.py > 54 > 55 # a hack to keep old versions of ipython working with mpl > 56 if 'IPython.Shell' in sys.modules: > ---> 57 new_figure_manager, draw_if_interactive, show = pylab_setup() > 58 > > /usr/lib64/python2.4/site-packages/matplotlib/backends/__init__.py in > pylab_setup() > 24 time.sleep(1) > 25 backend_mod = __import__('matplotlib.backends.'+backend_name, > ---> 26 globals(),locals(),[backend_name]) > 27 > 28 # Things we pull in from all backends > > /usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtkcairo.py > 7 import cairo.gtk > 8 > ----> 9 import matplotlib.backends.backend_cairo as be_cairo > 10 from matplotlib.backends.backend_gtk import * > 11 > > AttributeError: 'module' object has no attribute 'backends'
I found a workaround, and committed it. I don't understand what the root of the problem was, probably because the AttributeError at the end of the Traceback is misleading. Changing this: import matplotlib.backends.backend_cario as be_cairo to this: from matplotlib.backends import backend_cairo and updating references to be_cairo was all that was needed. The fix is in svn 2979. Darren ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel