Python 3.0.1 可执行文件创建器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/702395/
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-11-03 20:41:21  来源:igfitidea点击:

Python 3.0.1 Executable Creator

pythonexecutablepy2exepyinstaller

提问by Tony Trozzo

Does anyone know if there's a windows Python executable creator program available now that supports Python 3.0.1? It seems that py2exe and pyInstaller, along with all the rest I've found, still aren't anywhere close to supporting 3.0 or 3.0.1.

有谁知道现在是否有支持 Python 3.0.1 的 Windows Python 可执行创建程序?py2exe 和 pyInstaller 以及我发现的所有其他工具似乎仍然无法支持 3.0 或 3.0.1。

Any help is greatly appreciated.

任何帮助是极大的赞赏。

Edit: I guess I could downgrade the program to an older version of Python to make it work with py2exe. The hardest part will probably be using an older version of Tkinter.

编辑:我想我可以将程序降级到旧版本的 Python 以使其与 py2exe 一起使用。最难的部分可能是使用旧版本的 Tkinter。

Has anyone had luck with using py2exe or pyInstaller (or another windows-friendly program) to create an executable that uses Tkinter as well as subprocess.

有没有人有幸使用 py2exe 或 pyInstaller(或其他 Windows 友好程序)来创建使用 Tkinter 和子进程的可执行文件。

I'm actually not sure how to get the directory my program will be installed into so subprocess can find the executable program I'm using.

我实际上不确定如何获取我的程序将安装到的目录,以便子进程可以找到我正在使用的可执行程序。

采纳答案by dF.

Not answering the original question but this:

不回答原来的问题,而是这个:

I'm actually not sure how to get the directory my program will be installed into so subprocess can find the executable program I'm using.

我实际上不确定如何获取我的程序将安装到的目录,以便子进程可以找到我正在使用的可执行程序。

You can use something like

你可以使用类似的东西

if hasattr(sys, 'frozen'): # this means we're installed using py2exe/pyinstaller
    INSTDIR = os.path.dirname(sys.executable)
else:
    ...

回答by Titusz

How about cx_Freeze. Seems to support python 3.0 and 3.1?

cx_Freeze怎么。好像支持python 3.0和3.1?

回答by dotancohen

Python 3 is not supported by py2exe. The relevant bug to comment on is here:
https://sourceforge.net/p/py2exe/feature-requests/20/

不支持 Python 3 py2exe。要评论的相关错误在这里:https:
//sourceforge.net/p/py2exe/feature-requests/20/

py2exe for Python3 is out!

py2exe for Python3 出来了!

Here is the original bug report:
http://sourceforge.net/projects/py2exe/

这是原始错误报告:http:
//sourceforge.net/projects/py2exe/

Here is the comment mentioning the release:
http://sourceforge.net/projects/py2exe/

这是提及该版本的评论:http:
//sourceforge.net/projects/py2exe/

Here is the package on pypi:
https://pypi.python.org/pypi/py2exe/0.9.2.0

这是pypi上的包:https://pypi.python.org/pypi/py2exe/0.9.2.0

Note that py2exe for Python 3 only supports Python 3.3 and above!

请注意,Python 3 的 py2exe 仅支持 Python 3.3 及更高版本!

A huge thank you to the py2exe development team!

非常感谢 py2exe 开发团队!

回答by Free Wildebeest

After searching for many days I came to the conclusion that the isn't currently any method for making executables for python 3.0 scripts.

在搜索了很多天之后,我得出的结论是,目前没有任何方法可以为 python 3.0 脚本制作可执行文件。

One workaround I came up with was to use portable python: http://www.portablepython.com/releases/

我想出的一种解决方法是使用便携式 python:http: //www.portablepython.com/releases/

Which at least allows a separate install which you could distribute with your scripts to help users.

这至少允许单独安装,您可以将其与脚本一起分发以帮助用户。

回答by WrongAboutMostThings

I got it working with cx_freeze.

我让它与cx_freeze一起工作。

Was a bit of a hassle since you have to add a line of code to get around some errors but it turned out to go just fine with Python 3.1.1 and PyQt4.

有点麻烦,因为你必须添加一行代码来解决一些错误,但结果证明在 Python 3.1.1 和 PyQt4 上运行得很好。

Also see hereto check on that extra line of code etc.

另请参阅此处以检查额外的代码行等。