I posted this question online and it seems that it would be useful to post 
it here.

tl;dr: I found a work around by creating a symbolic link to matplotlib in 
the modules folder.

http://stackoverflow.com/questions/32428845/why-does-matplotlib-not-work-on-a-digitalocean-vps-with-web2py

I've got a digitalocean droplet and I deployed web2py using this script 
<https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh>.
 
I installed matplotlib as follows:


ssh root@ipdroplet
apt-get install python-matplotlib


and I can indeed import matplotlib if I simply run python on the command 
line after I've ssh'd. The problem is that when I run my app I get the 
following error:


<type 'exceptions.ImportError'> Cannot import module 
applications.app.modules.matplotlib

I'm guessing this has something to do with user www-data vs root but no 
idea how to resolve it. Any help much appreciated. The tips that are 
mentioned in this 
<https://groups.google.com/forum/#%21msg/web2py/TWgBjFIG1GU/FCHI6KnBcrEJ> 
link unfortunately didn't help me.

Thanks

*EDIT*

I should also mention that I'm not using the binary version of web2py. I've 
also managed to run python as www-data by doing sudo -u www-data python and 
I can import matplotlib there just fine.

*EDIT2*

When I was running locally on web2py 2.11.2-stable it worked fine. On my 
server though I was under 2.12.3-stable. I'm guessing this is probably the 
reason.





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to