-
IndentationError: unexpected indent
字符缩进问题,可能是缩进格式不对,或者有空格。建议改用Tab标准缩进 -
SyntaxError: invalid syntax
使用python关键字作为变量 -
SyntaxError: Missing parentheses in call to ‘print’
源码为2.x环境,当前运行环境为3.x。在2.x中print函数为 print “text”,3.x中改为 print(“text”) -
inconsistent use of tabs and spaces in indentation
空格与Tab混用,统一用Tab或4个空格 -
TypeError: a bytes-like object is required, not ‘str’
类型错误,在这里需要一个bytes类型数据,而不是一个字符串(str) -
‘bytes’ object has no attribute ‘encode’
bytes对象没有对应的encode属性,应该改为decode
只能对其编码,而不能解码 -
XX missing 1 required positional argument:XXX
表示函数缺少一个必要的参数,可能是传参的类型不对应导致 -
takes 1 positional argument but 2 were given
参数给多了 -
‘NoneType’ object has no attribute ‘XXX’
操作的对象为空,没有任何属性
python编译错误
最新推荐文章于 2022-10-25 22:38:59 发布