web2py + apache2 can't load Theano (Ubuntu Server 14.04)

29 views
Skip to first unread message

Jordan Myers

unread,
Mar 6, 2017, 3:17:10 PM3/6/17
to web2py-users
Hello

I've migrated my code to start using Apache2 after successful setup just using built-in Rocket server, but now for some reason loading Theano leads to import error. I thought maybe the issue was with Cython or something, but it will successfully import NumPy, Scipy, Gensim, and other libraries that are compiled to c. Again, Theano worked fine in old Rocket setup. 

Does anyone have an idea of what the issue is? If it helps, I once got a different error that Theano complained about not having access to write compile logs, but I then corrected that issue by modifying permissions in the applicable folder and the error just goes back to being a normal "cannot import module applications.[myapp].modules.theano" Theano is installed in /usr/local/lib/python2.7/dist-packages/ (verified by running help('theano') in python prompt) instead of /usr/lib/python2.7/dist-packages/ in case that's relevant.

Thanks for any suggestions,
-Jordan

Massimo Di Pierro

unread,
Mar 20, 2017, 10:43:53 AM3/20/17
to web2py-users
How is theano installed? Could it be apache2 is using a different pythonversion? In any case, I recommend you use Nginx over Apache.

Jordan Myers

unread,
Mar 20, 2017, 11:04:38 AM3/20/17
to web...@googlegroups.com
Thank you for the reply. Apparently the issue was only when I tried to import theano in a controller. This worked with the rocket server, but not with Apache for some reason. Moving the code to a module and only invoking it with my web2py_scheduler service solved the issue (an immediate response is not required for this application).

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/A-Jzv3WM0t8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages