在Python3.6上使用py2exe将.py转换为.ex

2024-05-09 01:45:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我对Python很陌生,正在使用Python 3.6。我想把我的.py文件转换成.exe文件。我是在this tutorial的帮助下学习的,但由于以下错误,我陷入了步骤3:

IndexError: tuple index out of range

设置.py:

from distutils.core import setup  
import py2exe  

setup(console=['hello.py'])*  

我该怎么解决?


Tags: 文件ofpyimportindex错误setup步骤
3条回答

GitHub上有一个项目,它设法让py2exe在python 3.6/3.7上工作: https://github.com/albertosottile/py2exe

还不支持Python3.6。。。您必须尝试使用Python3.3版本才能解决此错误..谢谢

Python 3.6 still isn't supported by Pyinstaller. So in order to use it you're Python 3.5 or 3.3 or bellow.

考虑使用https://www.pyinstaller.org/,它可以与3.6一起工作,也可以打包大多数库。

我可以导出PyQT应用程序,它现在可以在Win7和Win10上以可移植的形式使用(只需下载所有文件并启动.exe)。

相关问题 更多 >