Android来源:Repo没有显示任何初始化消息



我遵循了谷歌提供的下载源树的说明,但在我运行命令之后

$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1

我收到以下错误消息:

$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

我做错了什么?还是这只是代表回购的一个错误?

更新:现在我已经安装了Python2.7,我仍然有几乎完全相同的错误消息:

$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

我调用$ python -V,它说Python 2.7.1,所以我不知道还能做什么。

在我看来,你可能没有做几件事:将repo修改为+x和/或将其作为第一个要查找的目录放在$PATH语句中(可能使用另一个版本的repo)。你试过ls-al吗?您要查找的目录是隐藏的,您需要ls中的-a参数来查看隐藏的文件/目录。

更新:啊,刚刚看到你的更新。由于您使用的是Mac,因此需要使用Python 2.7。要做到这一点,你需要使用MacPort。这个网站为我提供了很多帮助:在MAC OS X 上安装PYTHON 2.7、EASY_INSTALL、PIP、VIRTUALENV和VIRTUALEDVWRAPPER

最新更新