Hi,
I'm facing a problem when I try to run a batch file from maya's script editor. For example I'm trying to execute renderman tractor-spool.bat but it seems there is difference between opening a cmd terminal directly from windows, and opening a cmd terminal from Maya. (same thing with powershell) Do you now why?
- calling tractor-spool.bat in a cmd window => ask me for a job script. (standard behavior)
- calling tractor-spool.bat from os.system or subprocess => C:\Program Files\Pixar\Tractor-2.3\bin\rmanpy.exe: No module named apps (wrong)
Do you know if the way maya is spawning the cmd or powershell window is different from running cmd (win+R cmd) ?
Thanks
This could be due to the environment in which the process was created.
You can pass a dictionary with the desired environment and current directory for the subprocess to run in.
https://docs.python.org/2/library/subprocess.html#popen-constructor
Thanks "lee.dunham" I assume that's the problem, I discover that my script is running perfectly on a "standard" windows machine, but if I'm running the script on the machine I actually using at work for dev purposes with PyCharm/Python3.7/Sublime etc. installed, I'm having the error.
So you're probably right. It requires some digging... ( It works with another user session on my machine as well...)
Can't find what you're looking for? Ask the community or share your knowledge.