Test the code. I think that this should run each time that you restart web2py. It will then display on the command line any missing libraries. Check what you are returning.