我曾尝试 repo init 源代码 Ubuntu 构建机器,它能够成功克隆代码。
repo 初始化 -u git@github.com:xxx/xx_manifest.git -b xxx
现在我正在尝试 repo init VM Ubuntu 机器中的源代码。
在得到如下错误之间:
Traceback (most recent call last):
File "/xxx/.repo/repo/main.py", line 56, in <module>
from subcmds.version import Version
File "/xxx/.repo/repo/subcmds/__init__.py", line 38, in <module>
['%s' % name])
File "/xxx/.repo/repo/subcmds/upload.py", line 27, in <module>
from hooks import RepoHook
File "/xxx/.repo/repo/hooks.py", line 472
file=sys.stderr)
^
SyntaxError: invalid syntax
python 版本在构建机器和 vm 机器 2.7.17 中是相同的。
最佳答案
试试这些命令
curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x ~/bin/repo
python3 ~/bin/repo init -u git@....
关于python - 语法错误 : invalid syntax to repo init in the AOSP code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65193998/