I solved this problem by adding
import os
import tempfile
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
before the import matplotlib and it's running, but i had problems with the plotting due to headless environment i was getting this error from py-Tk:
"no display name and $DISPLAY environment variable"
I Solved this by adding
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
I've seen your scripts for setting up web2py in such a different ways (with or without redmine/postgresql etc) and i liked this logic, i will go and setup a standard development environment in my remote machine/server so to avoid conflicts when uploading the application in a different environment -- if there is any suggestion, it would be more than pleasantly to hear it!
thanks for your great work!