repo下载报错SyntaxError: invalid syntax

执行repo init -u https://gitee.com/lindenis/manifest.git -b lindsdk -m lindsdk.xml命令后报以下错误:

  File "/bin/repo", line 51
    def print(self, *args, **kwargs):
            ^
SyntaxError: invalid syntax

发现是python链接的不对,我的ubuntu装了两个版本的python,分别是python2.7和python3.8,输入python后提示是python2.7,因为python软链接到python2上面了:

ll /usr/bin/python
lrwxrwxrwx 1 root root 16 Jul 28 15:16 /usr/bin/python -> /usr/bin/python2*

repo需要的是python3,所以需要修改一下上面的软链接:

sudo rm /usr/bin/python

sudo ln -s /usr/bin/python3 /usr/bin/python 

再次执行repo init -u https://gitee.com/lindenis/manifest.git -b lindsdk -m lindsdk.xml,就不报错了:

Downloading Repo source from https://gerrit.googlesource.com/git-repo
repo: Updating release signing keys to keyset ver 2.3

Your identity is: dokin
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /home/dokin/work/test

 

你可能感兴趣的:(软件工具,repo报错,repo,SyntaxError)