2012-01-31 26 views
1

我已經按照谷歌已經提供下載源代碼樹中的說明,但我運行命令的Android來源:回購不顯示任何初始化消息

$ 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 

我做錯了什麼?或者這只是代表回購的錯誤?

更新:現在,我已經安裝了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,所以我不知道是什麼否則我可以做。

+0

可能的重複[下載Android應用程序的聯繫人代碼](http://stackoverflow.com/questions/3465094/download-android-code-for-contacts-application) – Mogsdad 2015-08-31 14:48:41

回答

1

對我來說,你可能還沒有做過兩件事情:chmod'd回購+ +和/或把它放在你的$ PATH語句中作爲第一個查找目錄(並且可以使用另一個版本回購)。你嘗試過'ls -al'嗎?您正在查找的目錄是隱藏的,您需要在ls中使用-a參數來查看隱藏的文件/目錄。

更新:啊,只是看到你的更新。由於您使用的是Mac,因此您需要使用Python 2.7。爲此,您需要MacPort。這個網站給我提供了很多幫助:INSTALLING PYTHON 2.7, EASY_INSTALL, PIP, VIRTUALENV AND VIRTUALENVWRAPPER ON MAC OS X

+0

我稱爲chmod a + x,並將其添加到PATH中。 .lpo文件夾在那裏,但是它是空的。當我嘗試執行回購同步時,它告訴我我沒有初始化它。 編輯:好吧,我剛剛看到你的更新,我現在正在嘗試;我會讓你知道發生了什麼。 – roboguy12 2012-01-31 02:29:47

+0

好吧,現在我已經安裝了Python 2.7,我得到了相同的確切錯誤信息。我會用消息更新我的OP。 – roboguy12 2012-01-31 02:44:52

+0

對我來說,這是你的問題:http://stackoverflow.com/questions/3465094/download-android-code-for-contacts-application – Carlos 2012-01-31 10:01:23