gpt4 book ai didi

python - 在 mac 上构建适用于 windows .exe 的可执行应用程序

转载 作者:可可西里 更新时间:2023-11-01 10:03:43 28 4
gpt4 key购买 nike

我正在尝试构建一个用 python 编写的应用程序,它可以在 Windows 上运行而无需安装 python 或相关库(独立),我想在我的 mac 上执行此操作。我尝试了 Pyinstaller,但它似乎只能在构建应用程序的平台(在本例中为 osx)中生成可执行文件。有没有像 Pyinstaller 这样简单的方法,还是我必须以非常复杂的方式来做?由于我不是专家,后一种选择对我来说可能是不可能的。尝试在 Windows 上构建应用程序比使用 pyinstaller 在 Mac 上构建应用程序更明智吗?

最佳答案

对于 pyinstallerthey have clearly mentioned在 OS X 下运行时打包 Windows 二进制文件不支持,建议使用 Wine 为此。

1. Can I package Windows binaries while running under Linux?

No, this is not supported. Please use Wine for this, PyInstaller runsfine in Wine. You may also want to have a look at this thread in themailinglist. In version 1.4 we had build in some support for this, butit showed to work only half. It would require some Windows system onanother partition and would only work for pure Python programs. Assoon as you want a decent GUI (gtk, qt, wx), you would need to installWindows libraries anyhow. So it's much easier to just use Wine.

2. Can I package Windows binaries while running under OS X?

No, this is not supported. Please try Wine for this.

3. Can I package OS X binaries while running under Linux?

This is currently not possible at all. Sorry! Ifyou want to help out, you are very welcome.

关于python - 在 mac 上构建适用于 windows .exe 的可执行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42059632/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com