@Geoff - Thats what I suggested in my previous reply ;-)
On Wed, Apr 3, 2013 at 10:51 AM, Geoff Harvey <[email protected]> wrote: > Have you tried submitting the command like this? > > subprocess.Popen([mayaPath, scriptPath, > filename],stdout=subprocess.PIPE,stderr=subprocess.PIPE) > > I've always had much better luck running a tokenized list through a > subprocess than a space-delineated command ... > > geoff > > > > On Tue, Apr 2, 2013 at 2:38 PM, Jeremy YeoKhoo <[email protected]> wrote: > >> On Tuesday, 2 April 2013 13:59:33 UTC+11, Jeremy YeoKhoo wrote: >> > Hi guys, >> > >> > Im trying to execute a subprocess.Popen from the mayapy where it >> launches a python script. Im trying to do it from an external python >> interpreter (mayapy) because Im trying to export a file with an unloaded >> plugin. (Im getting problems with unloading the plugin as it keeps crashing >> my maya session.) So everything exports fine but its a little annoying that >> my maya session crashes. >> > >> > Heres my command line: >> > mayaPath= 'c:/program files/autodesk/maya2012/bin/mayapy.exe' >> > scriptPath= <some script> >> > filename= <some file> >> > subprocess.Popen(mayaPath+' '+scriptPath+' >> '+filename,stdout=subprocess.PIPE,stderr=subprocess.PIPE) >> > >> > I get the following error: >> > # Error: WindowsError: file C:\Program >> Files\Autodesk\Maya2012\bin\python26.zip\subprocess.py line 786: 6 # >> > >> > Could someone help? >> > >> > I have set environment variable to my PYTHONPATH to python's site >> packages from the Maya folder. And have set the MAYA_LOCATION to the maya's >> install location (Which I dont think was necessary) >> > >> > >> > This is painful.... >> >> Hi Justin, thanks again. >> >> I have actually tried running the code explicitly, taking care of the >> necessary whitespaces. Actually works on my machine at home using maya2011 >> with the same line but seem to return that error from the machine at work. >> Ive even checked network permissions. And running a simpler function. But >> no cigar.... >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
