Python exception error subprocess file is missing - but which file?
I have a code running on python 2.7.3 (windows) and I am trying to run it on python 2.7.8 (windows) and get the following error:
main: INFO ** Start Home **
Traceback (most recent call last):
File "C:\wamp\www\prenderer\src\main.py", line 82, in <module>
nuke_process = launch_nuke()
File "C:\wamp\www\prenderer\src\main.py", line 31, in launch_nuke
query = subprocess.Popen(r"query process", stdout=subprocess.PIPE)
File "F:\python27\lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "F:\python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
>>>
what's wrong?
+3
source to share
1 answer
Argument shell=True
:
query = subprocess.Popen(r"query process", stdout=subprocess.PIPE, shell=True)
or pass the command line argument as a list:
query = subprocess.Popen(["query", "process"], stdout=subprocess.PIPE)
Otherwise, it is query process
recognized as a program instead of query
.
+3
source to share