Python 子进程。调用进程错误:命令'adb devices'返回非零退出状态 127



我正在使用 Ubuntu12.04,我看到以下错误,在我看来,这是 python 以某种方式试图调用 adb 命令,但失败了。

/bin/sh: 1: adb: not found
Traceback (most recent call last):
 `File "./test.py", line 1395, in <module>
    main()
  File "./test.py", line 1218, in main
    Device.wait_for_device(TIMEOUT, None, a.getport())
  File "./test.py", line 433, in wait_for_device
    if (len(a) == 1 and get_attached_devices()):
  File "./test.py", line 126, in get_attached_devices
    lines = subprocess.check_output(adb_rel_path + 'adb devices', shell =True).split('n')
  File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
   subprocess.CalledProcessError: Command 'adb devices' returned non-zero exit status 127

我按照指示安装了pyadb:https://pypi.python.org/pypi/pyadb/0.1.1

但它仍然不起作用。我现在毫无头绪。有谁知道我是否缺少任何软件包或程序?

退出代码 127 表示"找不到命令",您确定可以从标准终端执行 abd 吗?

我遇到了同样的例外,而我确实尝试通过 buidout 安装两个版本的 python。所以我必须安装 build-essential,以便 buildout 可以执行 make 命令。

sudo apt-get install build-essential

最新更新