如何将 python 3.3 脚本转换为可执行文件?我找到了 PyInstaller 和 py2exe,但都不支持 3.3

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16770267/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 23:36:55  来源:igfitidea点击:

How can I turn a python 3.3 script into executable file? I found PyInstaller and py2exe, but both did not support 3.3

python

提问by Dennisboys

How can I turn a python 3.3 script into executable file? I found PyInstaller and py2exe, but all did not support 3.3.

如何将 python 3.3 脚本转换为可执行文件?我找到了 PyInstaller 和 py2exe,但都不支持 3.3。

http://www.pyinstaller.org/

http://www.pyinstaller.org/

http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/

http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/

Both of these tools support 2.7 at most. But my script is written in 3.3.

这两个工具最多支持 2.7。但是我的脚本是用 3.3 编写的。

And I searched the forum posts all pointed to old tools that did not support 3.3.

我搜索了论坛帖子,所有帖子都指向不支持 3.3 的旧工具。

回答by Ewan

Have you had a look at the Python 3.3 documentation? Specifically for Creating Build Distributionsand Creating Windows Installers

您是否看过 Python 3.3 文档?专门用于创建构建分发创建 Windows 安装程序

From the docs:

从文档:

Since the metadata is taken from the setup script, creating Windows installers is usually as easy as running:

python setup.py bdist_wininst

or the bdist command with the --formatsoption:

python setup.py bdist --formats=wininst

由于元数据是从安装脚本中获取的,因此创建 Windows 安装程序通常就像运行一样简单:

python setup.py bdist_wininst

或带有--formats选项的 bdist 命令 :

python setup.py bdist --formats=wininst

This does presume you have a setup.pyfile however.

但是,这确实假定您有一个setup.py文件。

回答by Joe Tennies

You can use cx_Freeze with Python 3.3. http://cx-freeze.sourceforge.net/

您可以在 Python 3.3 中使用 cx_Freeze。http://cx-freeze.sourceforge.net/

回答by wookie

Here is the link for the Python 3 version of py2exe.

这是 py2exe 的 Python 3 版本的链接。

http://sourceforge.net/p/py2exe/svn/HEAD/tree/trunk/py2exe-3/

Hope this is helpful.

希望这是有帮助的。

回答by moovon

Py2exe is now available for python3 also, download

Py2exe 现在也可用于 python3, 下载