Android Source:Repo不显示任何初始化消息

时间:2012-01-31 02:08:21

标签: android build repository

我已按照Google提供的有关下载源树的说明,但在运行命令后

$ 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

我做错了什么?或者这只是代表Repo的错误?

更新:现在我已经安装了Python 2.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,所以我不知道还能做些什么。

1 个答案:

答案 0 :(得分:1)

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

更新:啊,刚看到你的更新。由于您使用的是Mac,因此需要使用Python 2.7。为此,您需要MacPort它。这个网站为我提供了很多帮助:INSTALLING PYTHON 2.7, EASY_INSTALL, PIP, VIRTUALENV AND VIRTUALENVWRAPPER ON MAC OS X