I’m trying to append paths to the Maya.env via an external tool and while my path appears in the actual file just fine, Maya isn’t reading the file at all.
-I’ve tried placing the file in both c:\Users\ USER \Documents\maya\2016\ and c:\Users\ USER \Documents\maya
-I’ve looked for other Maya.env -files, making sure there’s only one
-I’ve looked at all userSetup.py -files, making sure none is modding the PYTHONPATH
-I’ve cleared the entire prefs -folder except the Maya.env -file
-I’ve tried removing everything in the Maya.env -file except one single PYTHONPATH -declaration
-I’ve tried replacing the backslashes with frontslashes, or with double backslashes
In Maya print all paths via:
import sys
for p in sys.path: print§
Other TA’s have looked at this and we are unable to pinpoint the cause of this problem. The Maya.env file works just fine on their computers.
from inside Maya, what does getenv “MAYA_APP_DIR” say? Maya.env should be in there.
try defining anything else weird in Maya.env, like “TEST_VAR=whatever” and then do “getenv TEST_VAR” from inside Maya to make sure that you do read that file.
Anything weird happening in “usersetup.py”? I think it is running after Maya.env is evaluated.
userSetup.py is processed during basic startup, at that point the env file has already been processed.
But not much else has actually happened.
The module that handles userSetup.py is locate at <maya_install>/Python/lib/site-packages/maya/app/startup/basic.py (at least on windows).
This is the first thing imported and executed by both the gui and batch startup modules.
Internally I’ve stopped using Maya.env altogether, instead we are using maya’s module files as these are additive and have version specific flags built into the syntax. Module docs
Theodox did an excellent write up on using modules as well.