SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] IPython problem

From: Steve C. <ste...@ya...> - 2007年01月16日 01:47:30
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 

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /