python异常错误子进程文件丢失,但什么文件?

2024-10-04 09:18:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个代码运行在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
>>> 

怎么了?在


Tags: inpysrcmainwindowswwwlinequery
1条回答
网友
1楼 · 发布于 2024-10-04 09:18:31

传递shell=True参数:

query = subprocess.Popen(r"query process", stdout=subprocess.PIPE, shell=True)

或将命令行参数作为列表传递:

^{pr2}$

否则,query process将被识别为程序,而不是{}。在

相关问题 更多 >