Hello Anvil Community,
Has anyone seen this import error before? I have used the anvil.users module quite a bit and never have had this happen to me. It only happens sometimes, and I can’t seem to figure out what is triggering it. I have a hard time repeatably replicating.
Error Message:
Code Sample:
This is the line that trigger the error.
user_data = anvil.users.get_user(allow_remembered=True)
Thank you as always!
As the message says, there may be a problem with the imports.
Try to put a print('importing module name')
at the beginning of every module and see what’s importing what.
EDIT
I also have noticed that the server modules are imported in alphabetical order, and that may cause some nasty surprises: In what order are server modules imported? - #2 by stefano.menci
Or I may be wrong, the modules are not loaded in alphabetical order, or they are loaded in alphabetical order only in certain conditions, and this could explain why you have hard time replicating the problem.
2 Likes
Thanks @stefano.menci , I really appreciate your response (I always find your posts insightful). I like your approach and will have to play around with it to see if I can track it down the root cause.