Thanks to all for the responses. Much appreciated. Will try the .module and 
revert.

 

Thanks once again 

 

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
etienne
Sent: 11 April 2019 09:07
To: web2py-users
Subject: [web2py] Re: Modules not loading in python 3

 

Hello,

 

The error message is a bit misleading but it is related to the way python 3 is 
managing modules. For files sitting in the same directory you have to modify 
the import from:

 

import mymodule

 

to 

 

import .mymodule

 

and it should work.

 

It turns out that on any import error, custom_import will give this message of  
"applications.app_name.modules.module_name"  not found.

 

 


Le dimanche 7 avril 2019 06:18:03 UTC+2, John Bannister a écrit :

 

 Hi all,

 

I have recently upgraded to python 3.6 from 2.7 running on Centos7 with apache. 
Problem I am having is as follows:-

1: I have a number of apps each of which has a number of modules. Whilst it 
seems that I can import modules from paython (such as pytz etc) and I can also 
import modules into controllers/models what I cant seem to be able to do is to 
import a module into another module.

 

Example :

 

I have 2 modules invoices and invoice in modules directory. I can import either 
or both into a controller but I cannot import invoice module into invoices 
module.

 

I have tried using applications.app_name.modules.invoice as well as just 
invoice (as both are in same directory) but not happening for me. 

 

I get same standard import error traceback whatever I use. i.e custom import 
error .. no module "applications.app_name.modules.module_name"  found

 

Note:- all is working fine in python 2.7

 

Has anyone come across this issue or does anyone have a solution? I have 
reverted back to 2.7 for now   

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to