点击Python Console后直接报错
解决办法:
仔细查阅会发现有一个_compat.py文件报错。找到这个并修改
注释掉101行到116行的代码,即
# if PY3:
# new_code = types.CodeType(len(varnames),
# 0,
# len(varnames),
# code.co_stacksize,
# code.co_flags,
# code.co_code,
# code.co_consts,
# code.co_names,
# varnames,
# code.co_filename,
# "__init__",
# code.co_firstlineno,
# code.co_lnotab,
# code.co_freevars,
# code.co_cellvars)
注释掉之后替换成以下的代码片段:
args = [len(varnames),
0,
len(varnames),
code.co_stacksize,
code.co_flags,
code.co_code,
code.co_consts,
code.co_names,
varnames,
code.co_filename,
"__init__",
code.co_firstlineno,
code.co_lnotab,
code.co_freevars,
code.co_cellvars]
if sys.version_info >= (3,8,0):
args.insert(2,0)
new_code = types.CodeType(*args)