ModuleNotFoundError (No module named 'shotgun_api3.lib.six.moves')

Hello everyone.

I’m totally new to python and API, so my question might be trivial to some.
I followed this tutorial by Autodesk in youtube to setup the environment:

Setting Up Your Environment with the Python API - YouTube

There were some hiccups in setting things up, but I managed to get until step [4:42] (in the video), where the video shows a sample script test.

When I ran the same code in my environment, it returned an error saying:

Exception has occurred: ModuleNotFoundError
No module named 'shotgun_api3.lib.six.moves'
  File "C:\Users\kxxx\python-api\shotgun_api3\shotgun.py", line 36, in <module>
    from .lib.six.moves import map
  File "C:\Users\kxxx\python-api\shotgun_api3\__init__.py", line 11, in <module>
    from .shotgun import (Shotgun, ShotgunError, ShotgunFileDownloadError, # noqa unused imports
  File "C:\Users\kxxx\python-api\Test_0001.py", line 3, in <module>
    import shotgun_api3
ModuleNotFoundError: No module named 'shotgun_api3.lib.six.moves'

I wonder what went wrong, and I have no clue on how to solve this issue.
May I ask anyone here for help to show me in the right direction on how to fix this?

Thank you in advance,
Amal

What version of python are you using?

Given that pretty much everyone has migrated to Python 3, I guess the dependency on six should be removed gradually.

I’ve seen this issued before on Python 3.12, thats why I asked.

Please keep in line with the VFX reference platform when choosing the python version.
The shotgun_api3 library is compatible up to 3.10 and possibly 3.11 atm.

Following the instructions and links given in the tutorial, I am using python 3.11.7.

Please use Python 3.10.
The api is not yet fully compatible with 3.11.

You should aim to follow the VFX reference platform for development:

Hope that helps :slight_smile:

i see. ok i will try to change to 3.10. thank you!

Hello folks, this should be fixed now on Python API v3.9.0 :slightly_smiling_face: