Maya fails on userSetup.py when running through poetry

userSetup.py loading fails wails with

Traceback (most recent call last):
  File "/net-home/sveinbjorn/dev/external/OpenPype/.venv/lib/python3.9/site-packages/past/builtins/misc.py", line 154, in execfile
    exec_(code, myglobals, mylocals)
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/hosts/maya/startup/userSetup.py", line 3, in <module>
    from openpype.settings import get_project_settings
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/settings/__init__.py", line 28, in <module>
    from .entities import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/settings/entities/__init__.py", line 73, in <module>
    from .base_entity import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/settings/entities/base_entity.py", line 18, in <module>
    from openpype.lib import Logger
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/lib/__init__.py", line 54, in <module>
    from .execute import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/lib/execute.py", line 10, in <module>
    from .log import Logger
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/lib/log.py", line 28, in <module>
    from openpype.client.mongo import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/client/__init__.py", line 1, in <module>
    from .mongo import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/client/mongo/__init__.py", line 1, in <module>
    from .mongo import (
  File "/net-home/sveinbjorn/dev/external/OpenPype/openpype/client/mongo/mongo.py", line 5, in <module>
    import pymongo
ModuleNotFoundError: No module named 'pymongo'

it seems that just the .venv/lib site-packages dir is on the pythonpath, however the maya launch seems to strip out the .venv/lib64 site-packages (where pymongo lives)

Could not find where maya modifies the $pythonpath to strip out the lib64 bit

modifying the userSetup.py to sys.path.append the lib64 folder allows Ayon to run within maya though

Does the problem still exist?


I don’t know if the difference is due to the operating system but I have a different folder structure
e.g.

  • site-packages path: OpenPype\.venv\Lib\site-packages
  • mongo.py: OpenPype\openpype\client\mongo.py

Does cloning/pulling the most recent Repo fixes the problem ?

Ah, forgot about this. Well, I haven’t tried starting from scratch again, so I’m not sure to be honest

Hi, I new to AYON / OpenPype but really interested on give it a go.
Recently our IT department installed the docker (0.4.2+2309071606) version of AYON (Windows) and I am trying to test it, I added maya app to “demo_Big_Feature” and it shows up and launch using the AYON launcher (1.0.0-beta.4) on windows but when I launch Maya 2020, I got the following error.

Maya 2020 uses python 2.7 which does not know “f” string formatting, when setting the Maya application in Ayon by default it has “use Python2” disabled then I turned on and I got a different error but it seems also related to python version.

In python 2.7 the regex module does not contain “fullmatch” attribute.

I am in a private network and IT add python 2.7 by default to every machine for our current pipeline, I am guessing this version is being picked by default by AYON launcher?!, should I ask to remove it and install python 3.9+ to try this out? or this is something else?

Thank you for your help.

I believe urllib dependency was recently downgraded with this PR Chore: Lower urllib3 to support older OpenSSL by iLLiCiTiT · Pull Request #5538 · ynput/OpenPype · GitHub but I’m not sure you have that in your beta version already.

According to this page that particular version it was downgraded to 1.26.16 should be Py2.7 compatible and thus should work with Maya 2020 again.

How to best update AYON to include that particular fix I’m not sure - likely it involves updating the openpype addon. I suspect @iLLiCiT or @milan can provide a more knowledgable answer on how to get that fix running in your AYON beta.

— Also, I feel like these last two posts are best moved into a new topic of its own (but I don’t have the admin rights to do so on this forum.)

Thank you @BigRoy for your prompt answer.
I think we will be testing AYON with latest DCCs version to avoid this issue, as newcomers to AYON our main goal is to understand a bit better how it works, the flexibility, the way to integrate our tooling, etc, so we can have a better idea of the implications to mix our current pipeline.
Yeah, sorry for not creating a new topic, but for sure I will posting more in the near future as our testing evolves :slight_smile: