the line #os.environ['MPLCONfigureDIR'] = tempfile.mkdtemp()
should be os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp() but now there is this error: ***************************** Traceback (most recent call last): File "/home/www-data/web2py/gluon/restricted.py", line 194, in restricted exec ccode in environment File "/home/www-data/web2py/applications/test/models/plugin_matplotlib.py", line 4, in <module> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas File "/home/www-data/web2py/gluon/custom_import.py", line 294, in __call__ fromlist, level) File "/home/www-data/web2py/gluon/custom_import.py", line 78, in __call__ level) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 28, in <module> from matplotlib.backend_bases import RendererBase,\ File "/home/www-data/web2py/gluon/custom_import.py", line 294, in __call__ fromlist, level) File "/home/www-data/web2py/gluon/custom_import.py", line 78, in __call__ level) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 29, in <module> import matplotlib.cbook as cbook AttributeError: 'module' object has no attribute 'cbook' *************************** import matplotlib.cbook as cbook works in cli andrej