No module named 'anvil.js.window'?

Pretty straightforward; I’m trying to use the AnvilAugment dependency that Stu created here but when I try to run my app it throws this error:

It seems to pertain to the import statement in the dependency
from anvil.js.window import jQuery as _S. Is there something I’m missing regarding anvil.js.window?

I’ve made sure to add the AnvilAugment “app” as a dependency on my main app in the Settings -> Dependencies -> Add a dependency: [My Apps] too.

It looks like you’re trying to call that from server code. Anvil augment is a client side library that has to interact with Javascript, so has to be called from client side code.

2 Likes

jshaffstall to the rescue! Thanks a bunch, that seemed to have been the root of it.

1 Like

Hi @vquach worth noting that it’s even easy to add anvilaugment. @owen.campbell mentioned the anvil extras library.

You can do

from anvil_extras import augment 

It’s included there already :wink:.

2 Likes

Thank you! I was unsure whether or not they were the same but opted for your implementation since it came from you :sweat_smile:

They’re the same. @owen.campbell and I both maintain the anvil-extras project. At some point I’ll get round to putting a banner on the original project and pointing to anvil-extras.

A post was split to a new topic: Help using anvil_extras Augment

A post was merged into an existing topic: Help using anvil_extras Augment