我正在尝试从我的 Python 文件创建一个 .exe 文件。我的设置文件包含以下代码(使用 PyBuilder 应用程序生成):
# setup.py
from distutils.core import setup
import py2exe
import sys
sys.stdout = open('screen.txt','w')
sys.stderr = open('errors.txt','w')
setup(name='Crypto Calculator',
version='1.0',
author='RedCode',
data_files=[],
windows=[{'script':'Crypto Calculator.py',
'icon_resources':[(1,'')],
}])
print("---Done---")
当我运行命令时,pyinstaller setup.pyw
我得到了IndexError: tuple out of range
错误。当我尝试在我的实际应用程序文件上运行 pyinstaller 命令时,它仍然给我同样的错误。
如何更正此问题并成功创建 Python exe 文件。