环境windows10,64位,python3.6,py2exe0.9.2.2(最新的)
问题:py2exe打包报错ndexError: tuple index out of range.
分析:查了一下官方http://www.py2exe.org/ 和PYPI https://pypi.python.org/pypi/py2exe/0.9.2.2,
说是支持,但多种方法尝试无用。又在SO看到https://stackoverflow.com/questions/41578808/python-indexerror-tuple-index-out-of-range-when-using-py2exe,贴出The failure you're seeing occurs in py2exe opcode parsing code, which, given the most recent posted version of py2exe only claims support for 3.3 and 3.4, could not possibly have knowledge of, or support for, the new wordcode opcodes; they hadn't even been conceived of at the time py2exe was last updated. The bytecode often changes in small ways from version to version that could break even Python 3.5 (given only 3.3 and 3.4 support is claimed explicitly), but 3.6 is 100% guaranteed to fail.存在版本不适用性,果断放弃py2exe.
解决:使用pyinstaller(3.3.1)打包,打包py3.6版本的程序没有问题。
问题:py2exe打包报错ndexError: tuple index out of range.
分析:查了一下官方http://www.py2exe.org/ 和PYPI https://pypi.python.org/pypi/py2exe/0.9.2.2,
说是支持,但多种方法尝试无用。又在SO看到https://stackoverflow.com/questions/41578808/python-indexerror-tuple-index-out-of-range-when-using-py2exe,贴出The failure you're seeing occurs in py2exe opcode parsing code, which, given the most recent posted version of py2exe only claims support for 3.3 and 3.4, could not possibly have knowledge of, or support for, the new wordcode opcodes; they hadn't even been conceived of at the time py2exe was last updated. The bytecode often changes in small ways from version to version that could break even Python 3.5 (given only 3.3 and 3.4 support is claimed explicitly), but 3.6 is 100% guaranteed to fail.存在版本不适用性,果断放弃py2exe.
解决:使用pyinstaller(3.3.1)打包,打包py3.6版本的程序没有问题。