zope+matplotlib import problems

Hi to all,

I’m writing a web application with zope+python. I’ve made a first try to insert a graph using zope external method an following the instruction reported in this sample:

http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope

I have some problem with the imports; zope tell me:

              Error Type: ImportError
              Error Value: cannot import name FigureCanvasAgg

This is due to the instruction 7:

1 import matplotlib
2 matplotlib.use(‘Agg’)
3 from pylab import *
4 from os import *
5 from StringIO import StringIO
6 from PIL import Image as PILImage

7 from matplotlib.backends.backend_agg import FigureCanvasAgg
[…]

The path of the file backends_agg.py is correct. Have you got any suggestion.

Thanks.