[android]初始化代码仓库时出现“OSError: [Errno 2] No such file or directory”错误

 OSError: [Errno 2] No such file or directory
root@shanmin-ubuntu:/home/android/src# ../repo init -u git://android.git.kernel.org/platform/manifest.git 
Traceback (most recent call last):
  File "../repo", line 595, in <module>
    main(sys.argv[1:])
  File "../repo", line 562, in main
    _Init(args)
  File "../repo", line 181, in _Init
    _CheckGitVersion()
  File "../repo", line 210, in _CheckGitVersion
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
这是由于没有安装git造成的,安装上git就可以了。按说程序里面应该判断一下系统是否安装了git,不知道为什么没有判断。
apt-get install git

你可能感兴趣的:(android,code,移动开发,git,source,休闲)