Can't import plugin module

72 views
Skip to first unread message

Jurgis Pralgauskis

unread,
Dec 21, 2016, 8:29:25 AM12/21/16
to web2py-users
Hi,

I am trying to make plugin, but ran into



Version 2.14.6-stable+timestamp.2016.05.09.19.18.48

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last):
File "/home/jurgis/dev/web2py_git/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File "/home/jurgis/dev/web2py_git/applications/app/controllers/plugin_joins_builder.py:index", line 3, in <module>
File "/home/jurgis/dev/web2py_git/gluon/custom_import.py", line 104, in custom_importer
raise ImportError(e1, import_tb) # there an import error in the module
ImportError: (ImportError('No module named modules.plugin_joins_builder.joins_builder',), <traceback object at 0x7f70f0098a70>)

In file: /home/jurgis/dev/web2py_git/applications/app/controllers/plugin_joins_builder.py

1.
<code object <module> at 0x7f70f00e0a30, file "/home/jurgis/dev/web2py_git/applications/app/controllers/plugin_joins_builder.py:index", line 3>


The code:
https://github.com/dz0/web2py_grand_helpers/blob/master/app/controllers/plugin_joins_builder.py#L3
https://github.com/dz0/web2py_grand_helpers/tree/master/app/modules/plugin_joins_builder

Anthony

unread,
Dec 21, 2016, 8:45:12 AM12/21/16
to web2py-users
There is no __init__.py file in your /modules folder, nor in the app folder (should also be one in the /applications folder).

Anthony

Johann Spies

unread,
Apr 11, 2017, 10:15:54 AM4/11/17
to web2py-users


On Wednesday, 21 December 2016 15:45:12 UTC+2, Anthony wrote:
There is no __init__.py file in your /modules folder, nor in the app folder (should also be one in the /applications folder).

Anthony

On Wednesday, December 21, 2016 at 8:29:25 AM UTC-5, Jurgis Pralgauskis wrote:
Hi,

I am trying to make plugin, but ran into



Version 2.14.6-stable+timestamp.2016.05.09.19.18.48

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last):
File "/home/jurgis/dev/web2py_git/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File "/home/jurgis/dev/web2py_git/applications/app/controllers/plugin_joins_builder.py:index", line 3, in <module>
File "/home/jurgis/dev/web2py_git/gluon/custom_import.py", line 104, in custom_importer
raise ImportError(e1, import_tb) # there an import error in the module
ImportError: (ImportError('No module named modules.plugin_joins_builder.joins_builder',), <traceback object at 0x7f70f0098a70>)


I get the same error (and have had this problem numerous times before). This is frustrating.

The contents of the modules directory:
$ ls
__init__.py  __init__.pyc  pretty.py  pretty.pyc

I have tried:

from pretty import *

and

from applications.wos_2016_1.modules.pretty import *

with no success.

This is on localhost and I have restarted web2py with every change.

Regards
Johann

 
Reply all
Reply to author
Forward
0 new messages