在利用pyinstaller打包py文件为exe时,出现“IndexError: tuple index out of range
”问题,完整错误代码如下:
win10
python3.10
pycharm2020.3
C:\Users\hp\AppData\Local\Programs\Python\Python310\Lib\dis.py
(每个人的路径可能不同)_unpack_opargs(code)
函数else
中添加extended_arg = 0
语句def _unpack_opargs(code):
extended_arg = 0
for i in range(0, len(code), 2):
op = code[i]
if op >= HAVE_ARGUMENT:
arg = code[i+1] | extended_arg
extended_arg = (arg << 8) if op == EXTENDED_ARG else 0
else:
arg = None
extended_arg = 0
yield (i, op, arg)