[Fixed] Importing client modules doco is wrong

What I’m trying to do:
Import a client module

What I’ve tried and what’s not working:

As per the auto-created documentation comment inside Module1

from . import Module1

trying to run the app I get the error

AttributeError: (most likely due to a circular import) partially initialized module ‘M3_App_2.Form1’ has no attribute ‘Module1’

Code Sample:

Solution: You need to use

from .. import Module1

to have it work. The doco in the modules needs to be updated, and possibly other Anvil documentation.

Clone link:
share a copy of your app

Thanks for raising

I agree this is misleading, we’ll adjust the example code.

Our general advice is - always use the auto-completer suggestions when importing modules.

3 Likes