Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python异常错误子进程文件丢失-但是哪个文件?_Python_Windows_Python 2.7 - Fatal编程技术网

python异常错误子进程文件丢失-但是哪个文件?

python异常错误子进程文件丢失-但是哪个文件?,python,windows,python-2.7,Python,Windows,Python 2.7,我有一个在python 2.7.3(windows)上运行的代码,我尝试在python 2.7.8(windows)上运行它,并得到以下错误: 主:信息**启动主** 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\prender

我有一个在python 2.7.3(windows)上运行的代码,我尝试在python 2.7.8(windows)上运行它,并得到以下错误:

主:信息**启动主**

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
>>> 
回溯(最近一次呼叫最后一次):
文件“C:\wamp\www\prenderer\src\main.py”,第82行,在
核武器进程=发射核武器()
文件“C:\wamp\www\prenderer\src\main.py”,第31行,在launch_nuke中
query=subprocess.Popen(r“query process”,stdout=subprocess.PIPE)
文件“F:\python27\lib\subprocess.py”,第710行,在_init中__
错误读取,错误写入)
文件“F:\python27\lib\subprocess.py”,第958行,在执行子进程中
startupinfo)
WindowsError:[错误2]系统找不到指定的文件
>>> 

怎么了?

传递
shell=True
参数:

query = subprocess.Popen(r"query process", stdout=subprocess.PIPE, shell=True)
或将命令行参数作为列表传递:

query = subprocess.Popen(["query", "process"], stdout=subprocess.PIPE)
否则,将
查询过程
识别为程序,而不是
查询