Use `import datetime` instead of `from datetime import datetime`
According to this web2py mailing list discussion, use of from datetime import datetime
conflicts with use of import datetime
and calling datetime.datetime.now()
. The problem shows up when using the scheduler.
To avoid such conflict, use of from datetime import datetime
must be replaced by import datetime
, and calls to datetime.XXX
must be replace with calls to datetime.datetime.XXX
.
The problem occurs when the name of the module is the same as the name of the import. It is a python problem.