I posted this on the pythonanywhere (PAW) forums also but I think it may be web2py specific (or at least specific to the PAW/web2py combination) ...
I'm using weasyprint to generate a PDF. It's working on my local dev environment and my PAW personal account.
On a new PAW account it fails on:
from weasyprint import HTML, CSS
with the error:
OSError: dlopen() failed to load a library: cairo / cairo-2
On the new PAW account, the import works in a python console (just not from within the web2py app).
As far as I can tell, the original and new PAW accounts are identical. I also recently create a new virtualenv on the new account to try and isolate the library/package that may be out of sync but I'm getting the same error.
Any ideas how to debug?