Ubuntu电脑的默认版本是python2.7
但是repo时确用的是python3
更改方法:
➜ localbin which repo
/home/wq/Applications/localbin/repo
➜ localbin vim repo
打开repo文件后会发现,以下代码
def check_python_version():
"""Make sure the active Python version is recent enough."""
def reexec(prog):
exec_command([prog] + sys.argv)
MIN_PYTHON_VERSION = (3, 6)
ver = sys.version_info
major = ver.major
minor = ver.minor
MIN_PYTHON_VERSION定义python版本,把MIN_PYTHON_VERSION = (3, 6)改为MIN_PYTHON_VERSION = (2, 7)即可