ModuleNotFoundError:

What I’m trying to do:

Run Anvil App Locally

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

Following the tutorial here.

Code Sample:

File "C:\usr\Anvil_Practice\git_clone_practice\lib\site-packages\anvil_downlink_host\full_python.py", line 3, in <module>
    from anvil_downlink_util.pipes import MessagePipe
ModuleNotFoundError: No module named 'anvil_downlink_util' 

Welcome! But it’s difficult to help without more details:

1 Like

sure thing. I’ll edit it on the main post

full_python.py is trying to import MessagePipe from the anvil_downlink_util module. The error its giving me is saying I don’t have a module named anvil_downlink_util. I assume its supposed to come in the package when installing the standalone server.

That’s actually not the kind of details I had in mind. (We can read the error message.) I was thinking maybe you could say more about which steps in that tutorial you have done so far. What led to that error message? Or maybe you could run some diagnostics to show what your environment looks like? (This is not something I have done myself, so I probably can’t help you, personally. And I’m not even necessarily qualified to advise you on what would better enable others to help you. But this is my best attempt.)

1 Like

I’ll second @hugetim’s reply. Context matters. If your context was exactly the same as in the tutorial, then things would be working. Since things are not working, something in your context must be different. That difference – which might be one of many differences – is probably the source of the problem.

But no one here can see those differences, without your help.

1 Like

First off, I’m using windows 10, Visual Studio Code and Powershell.

Ok so here’s the actual step by step that I have done:

  1. created a virtual environment using virtualenv .
  2. activated the environment
  3. installed the Anvil App Server using pip install anvil-app-server
  4. installed Eclipse Temurin for Windows from here. Which is an OpenJDK.
  5. Restarted PC.
  6. cloned practice app from Anvil Builder using Git
  7. ran the app using anvil-app-server --app <app-name>

Here is my dependencies list

anvil-app-server==1.6.3
anvil-uplink==0.3.40     
certifi==2021.5.30       
charset-normalizer==2.0.6
cli-helpers==2.2.0       
click==8.0.1
colorama==0.4.4
configobj==5.0.6
future==0.18.2
idna==3.2
pendulum==2.1.2
pgcli==3.2.0
pgspecial==1.13.0        
progressbar2==3.53.3     
prompt-toolkit==3.0.20   
psutil==5.8.0
psycopg2==2.9.1
pychrome==0.2.3
Pygments==2.10.0
python-dateutil==2.8.2   
python-utils==2.5.6      
pytzdata==2020.1
requests==2.26.0
setproctitle==1.2.2      
six==1.16.0
sqlparse==0.4.2
tabulate==0.8.9
urllib3==1.26.7
wcwidth==0.2.5
websocket-client==1.2.1
ws4py==0.5.1

So, strange enough I decided to attempt to create a blank app using create-anvil-app instead of cloning the one from the builder and it runs fine because it has the anvil_downlink_uitl site package. After simply copying that folder over into the cloned one it seems to work just fine. I’m not sure how the package got overlooked in my steps but I intend on doing a fresh one to see if the builder omits it whereas create-anvil-app does not.

2 Likes