--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk35R3O1iT%2BFK55-PKCOd5WKbizRWZM%2BBYrrxeigJzSK3WQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/21FF88DF-3720-4B8F-ADE6-C5D667A0E5BB%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
Ya but MAYA_SCRIPT_PATH is an application specific environment variable that Maya is free to read it at any time.
PYTHONPATH is specific to python. If Maya is choosing to read it from the env after initialization, I would consider it undefined behavior.
http://docs.python.org/2/tutorial/modules.html#the-module-search-path
"sys.path is initialized from these locations:
the directory containing the input script (or the current directory).
PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).
the installation-dependent default.
After initialization, Python programs can modify sys.path."
So you can see that after a python interpreter has initialized , you should be using sys.path and not banking on modifying the env for python imports. Unless you are doing it so that subprocesses will inherit the modification, although that should really be done specifically by passing an env dict anyways.
Mel is a different story and follows the semantics defined by Maya.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk36xiov1iijBo%3DkM04DfUxyO5n8wALY2RrD1Mc38j%3Da%2BhQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1jKu-cLJPUX1nZG4sLjpDLgPcX9nB1CzEovKzOPbrckw%40mail.gmail.com.
I would still only use sys.path in userSetup.py as for all I know its being exec'd into the already initialized python interpreter.
Maya.env might be the place for PYTHONPATH modifications.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABBPk36Lot68WEMCW8WBUDwC4hRhrOYzd%3Dg%2Bb23g5RDbFgodng%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2NfBkUCDMMnyvHLUQda5DP%3D%2BrNTxuRN5AYEZN9N5_gWQ%40mail.gmail.com.