构建chrome时出错,subprocess.call抛出“没有这样的文件或目录”

时间:2012-12-24 15:44:42

标签: python exception subprocess

Traceback (most recent call last):
  File "scripts/rule_bison.py", line 75, in <module>
    return Code = subprocess.call([bisonExe, '-d', '-p', prefix, inputFile, '-o', outputCpp])
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

我正在尝试使用忍者来构建铬源代码。然后我得到了上面的错误。我不知道该怎么弄清楚。你能给我任何想法吗?

1 个答案:

答案 0 :(得分:3)

这意味着找不到变量bisonExe命名的任何二进制文件。对于任何不存在的二进制文件,将抛出Errno 2错误:

>>> subprocess.call(['spamandeggs', '-V'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory