Python 3.10.0 使用pyinstaller打包成exe可执行文件出错。

image.png

官方文档说PyInstaller已经支持3.7之后的python版本,但在运行过程中还是遇到,IndexError: tuple index out of range问题。

解决办法:
编辑python310Lib下的dis.py文件。

找到def _unpack_opargs(code)函数,在else语句中添加extended_arg=0,如下图所示。image.png

Last modification:January 31, 2023
如果觉得文章对你有用,请随意赞赏