Anvil Community Forum

[FIXED] Which python version do I need to set up Uplink?

What I’m trying to do:

Hi, I’m trying to set up Uplink following the Quickstart tutorial using the latest python 3.10. When trying to import anvil.server , I get the following error:

/Users/clauslang/PycharmProjects/Kodex/venv/bin/python /Users/clauslang/PycharmProjects/Kodex/hello.py
Traceback (most recent call last):
  File "/Users/clauslang/PycharmProjects/Kodex/hello.py", line 1, in <module>
    import anvil.server
  File "/Users/clauslang/PycharmProjects/Kodex/venv/lib/python3.10/site-packages/anvil/__init__.py", line 161, in <module>
    from ._components import *
  File "/Users/clauslang/PycharmProjects/Kodex/venv/lib/python3.10/site-packages/anvil/_components.py", line 3, in <module>
    from . import server, _server
  File "/Users/clauslang/PycharmProjects/Kodex/venv/lib/python3.10/site-packages/anvil/server.py", line 80, in <module>
    class TaskState(threading.local, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping' ``` 

I suspect this has to do with the python version and that I should try 3.6 since that’s the latest version I can choose for the server modules in the online editor? Would like to confirm first since at the moment, it is a bit of a difficult process to install older python versions on the new Macbook M1 I’m using. Also, python 3.6 is reaching end of life soon, so would like to use a more recent version ideally.

Thanks for reporting this.
We’ve moved it to bug reports.
Python 3.10 should work and we’ll be implementing a fix for this soon.

Until then, python (up to) 3.9.x works.

1 Like

We have now released the uplink v0.3.41 with support for Python 3.10, which should solve this for you. Thanks for the report!

3 Likes

Works great, thank you!