On Mon, 2007-01-15 at 08:26 -0700, Fernando Perez wrote:
> Those lines also work fine from an ipython prompt:
> 
> In [1]: from matplotlib.backends import backend_cairo
> 
> In [2]: from matplotlib.backends.backend_gtk import *

They work, but they are not relevant to this problem. Darren has
confused the issue by applying a fix to backend_gtkcairo.py (with no
CHANGELOG comment) while you and I are investigating the problem. So we
are executing the workaround command and are unable to reproduce the
bug.

However, if I put the line
import matplotlib.backends.backend_cairo as be_cairo
back into backend_gtkcairo.py I can now see the problem.

$ python
Python 2.4.3 (#1, Oct  1 2006, 18:00:19) 
[GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.backends.backend_gtkcairo


$ ipython 
Python 2.4.3 (#1, Oct  1 2006, 18:00:19) 
Type "copyright", "credits" or "license" for more information.

IPython 0.7.2 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import matplotlib.backends.backend_gtkcairo.py
---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most
recent call last)

/home/iuser/<ipython console> 

/usr/lib/python2.4/site-packages/matplotlib/backends/__init__.py 
     52 
     53 # a hack to keep old versions of ipython working with mpl
     54 if 'IPython.Shell' in  sys.modules:
---> 55     new_figure_manager, draw_if_interactive, show =
pylab_setup()
     56 

/usr/lib/python2.4/site-packages/matplotlib/backends/__init__.py in
pylab_setup()
     22     backend_name = 'backend_'+backend.lower()
     23     backend_mod =
__import__('matplotlib.backends.'+backend_name,
---> 24                              globals(),locals(),[backend_name])
     25 
     26     # Things we pull in from all backends

/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkcairo.py 
      8 
      9 #from matplotlib.backends import backend_cairo
---> 10 import matplotlib.backends.backend_cairo as be_cairo
     11 from matplotlib.backends.backend_gtk import *
     12 

AttributeError: 'module' object has no attribute 'backends'







Send instant messages to your online friends http://au.messenger.yahoo.com 


-------------------------------------------------------------------------
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

Reply via email to