userSetup.py is not executed despite being in path


#1

I have a Maya.env file with this line:
PYTHONPATH=/Users/myuser/blabla/something/maya

…and a userSetup.py file on that path.

In Maya I can see that /Users/myuser/blabla/something/maya has been added just fine.

import sys
print(sys.path)

import os
print(os.environ[“PYTHONPATH”])

Both of these say that my path is added, but even though this is the case my userSetup.py is not executed at all during Maya startup. I have prints in the Python file and I see no output in the script editor and my code doesn’t run.

What is going on?


#2

I think the userSetup.py should go inside maya/scripts or maya/maya20xx/scripts in order to be picked up. Let me know how it goes :grinning:


#3

I migrated the code in userSetup.py to userSetup.mel and it runs just fine now.
There is something odd going on about the Python version of this file - and by odd I mean something regarding Maya’s startup behavior.