repo init返回WindowsError:[错误2]

时间:2018-11-22 17:25:04

标签: python repo

环境:

  1. Windows 7
  2. Python 2.7(64位)

当我运行repo init -u https://android.googlesource.com/platform/manifest时,它会产生以下错误:

Traceback (most recent call last):

  File "F:\android source code\.repo\repo/main.py", line 538, in <module>
    _Main(sys.argv[1:])

  File "F:\android source code\.repo\repo/main.py", line 512, in _Main
    result = repo._Run(argv) or 0

  File "F:\android source code\.repo\repo/main.py", line 181, in _Run
    portable.NoPager(cmd)

  File "F:\android source code\.repo\repo\portable.py", line 277, in NoPager
    RunWindowsShell(cmd)

  File "F:\android source code\.repo\repo\portable.py", line 281, in RunWindowsS
hell
    redirect_all(executable)

  File "F:\android source code\.repo\repo\portable.py", line 288, in redirect_al
l
    p = subprocess.Popen([executable], stdin=subprocess.PIPE, stdout=old_sysout,
 stderr=old_syserr)

  File "C:\Python27\lib\subprocess.py", line 394, in __init__
    errread, errwrite)

  File "C:\Python27\lib\subprocess.py", line 644, in _execute_child
    startupinfo)

WindowsError: [Error 2]

1 个答案:

答案 0 :(得分:0)

Windows错误2表示找不到文件。验证每个寻址文件(如果它们确实存在于预期位置)并且访问权限合适。最终,您必须以管理员权限运行脚本。