How to ship numpy with web2py application under myapp/modules?
Posted
by
Newbie07
on Stack Overflow
See other posts from Stack Overflow
or by Newbie07
Published on 2013-06-29T04:17:47Z
Indexed on
2013/06/29
4:21 UTC
Read the original article
Hit count: 334
I am having the following error while importing numpy from application/myapp/modules:
Traceback (most recent call last): File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 212, in restricted File "D:/web2py_win/web2py/applications/myapp/controllers/default.py", line 13, in File "/home/mdipierro/make_web2py/web2py/gluon/custom_import.py", line 100, in custom_importer File "applications\myapp\modules\numpy\ __init__.py", line 137, in File "/home/mdipierro/make_web2py/web2py/gluon/custom_import.py", line 81, in custom_importer ImportError: Cannot import module 'add_newdocs'
I tried adding 'application.myapp.modules.' in the 'import add_newdocs' statement of numpy\ __init.py__
and the error propagates to other subsequent imports(i.e. add_docs imports some other stuff and I get the ImportError again for these imports). So I narrowed down the problem to the "working directory" of the import statement. However, I do not wish to add 'application.myapp.modules.' in every import statement inside the package since it would be impractical and hard to edit if someone decides to rename the app later on. How do I make the import work smoothly?
NOTE: It is necessary for me to put the numpy package in the app to ensure ease of deployment.
© Stack Overflow or respective owner