Can someone explain this inconsistency?
This import
is automatically added to a new server module and doesn’t work in an uplink module:
import anvil.tables as tables
from anvil.tables import app_tables
This works on both server and uplink modules:
from tables import app_tables
I replace the server version with the uplink, so I can import the server module on an uplink one.
We moved those packages a little while ago, to avoid conflict with other top-level modules, particularly on the Uplink (we made an announcement post a few months ago, although the uplink was a little slower to update). The original names (eg import tables
) still work for now, on the server and in older versions of the uplink, but we recommend moving to the anvil.*
namespace (eg import anvil.tables
).
If you upgrade to the latest version of the uplink, you’ll find that import anvil.tables
works:
pip install --upgrade anvil-uplink
1 Like