pyinstaller 时碰到 struct.error argument out of range - 蝈蝈俊
💡
原文中文,约2700字,阅读约需7分钟。
📝
内容提要
本文介绍了使用PyInstaller打包Python程序时遇到的错误,即struct.error argument out of range。错误是在版本号中出现的,每个版本号的每一部分都应该是一个16位的数字,而上面的版本号中,20230913超出了这个范围。
🎯
关键要点
- 使用 PyInstaller 打包 Python 程序时可能遇到 struct.error: argument out of range 错误。
- 该错误通常表示传递给 struct 函数的参数超出了其处理范围。
- 错误发生在复制版本信息到 EXE 时,具体堆栈信息显示了错误的来源。
- file_version_info.txt 文件是通过 pyinstaller_versionfile 模块生成的,包含版本信息。
- 版本号的每一部分(主版本、次版本、构建号、修订号)应为16位数字,范围为0到65535。
- 示例中的版本号 20230913 超出了16位数字的范围,导致错误。
🏷️
标签
➡️