.repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax

简介: .repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax

【问题描述】:

使用repo命令下载是提示以下错误:

File ".repo/repo/main.py", line 79
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

【分析过程】:

确认.repo/repo/main.py文件是python3的语法,如下:

#!/usr/bin/env python3
# 
# Copyright (C) 2008 The Android Open Source Project

而当前服务器python为python2.7,切换到3.6之后仍然存在问题,考虑重新换一个repo工具。

【解决方案】:

curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ./repo
chmod a+x repo

更换repo工具后下载成功


目录
相关文章
|
4天前
|
Python
【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘
【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘
6 0
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
问题提解决:ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.pythonhos
问题提解决:ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.pythonhos
|
4天前
|
Python
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
完美解决丨File “invalid.py“, line 1 print(`Hello World!`) ^ SyntaxError: invalid syntax
|
4天前
Parsing error: No Babel config file detected for XXXXX
Parsing error: No Babel config file detected for XXXXX
|
6月前
|
Python
ERROR: file or directory not found: xx.py
​ 1、问题出现原因 在vscode中已导入pytest框架,做自动化demo小测试,运行Python文件一直出现如题错误,截图如下: ERROR: file or directory not found: xx.py  2、解决办法 1)直接把该文件移到当前主目录下,放在PYTHON-STUDY下 2)VSCode中右键tuopan.py文件,选择[在集成终端中打开],或者通过CD命令进入到tuopan.py文件所在目录 然后输入以下命令即可: 注:上述命令不是换行,在d:/前有空格 ,第一行信息为python所在安装路径,空格后的换行为运行的python文件的所在路径  
78 0
|
9月前
|
C语言
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
安装mujoco报错:distutils.errors.DistutilsExecError: command ‘gcc‘ failed with exit status 1
299 0
Parse error: syntax error, unexpected '<<' (T_SL) in .../test2.php on line 2
Parse error: syntax error, unexpected '<<' (T_SL) in .../test2.php on line 2
105 0
|
C语言
configure:3855: gcc -V >&5 gcc: error: unrecognized command line option '-V'
configure:3855: gcc -V >&5 gcc: error: unrecognized command line option '-V'
505 0
|
PyTorch 算法框架/工具
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
164 0
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument