【问题标题】:Creating an exe file for windows using mac for my Kivy app使用 Mac 为我的 Kivy 应用程序创建 Windows 的 exe 文件
【发布时间】:2018-07-25 09:28:59
【问题描述】:

我创建了一个 kivy 应用程序,它可以按照我的意愿完美运行。它在它使用的特定文件夹中有一些文件。对于我的生活,我不明白如何在 mac 上创建一个 exe。我知道我可以使用 pyinstaller,但是如何从 mac 创建一个 exe。

请帮忙!

【问题讨论】:

  • exe for mac?好吧。
  • exe 是指 Windows 可执行文件吗?

标签: python kivy pyinstaller kivy-language


【解决方案1】:

对于 pyinstaller,他们声明不支持在 OS X 下运行时打包 Windows 二进制文件,并建议为此使用 Wine。

  1. 我能否在 Linux 下运行时打包 Windows 二进制文件?

不,不支持。请为此使用 Wine,PyInstaller 运行 在葡萄酒中很好。您可能还想看看这个线程 邮件列表。在 1.4 版本中,我们对此进行了一些支持,但是 它显示只工作了一半。它需要一些Windows系统 另一个分区,仅适用于纯 Python 程序。作为 只要你想要一个像样的 GUI(gtk、qt、wx),你就需要安装 无论如何,Windows 库。所以使用 Wine 会容易得多。

  1. 我可以在 OS X 下运行时打包 Windows 二进制文件吗?

不,不支持。请为此尝试 Wine。

  1. 我可以在 Linux 下运行时打包 OS X 二进制文件吗?

目前这根本不可能。对不起!如果你想帮忙, 不客气。

【讨论】:

    【解决方案2】:

    使用Pyinstaller 很容易。我最近用过。

    安装pyinstaller

    pip 安装 pyinstaller

    terminal 上点击以下命令,其中file.py 是您的主文件的路径

    pyinstaller -w -F file.py

    您的exe 将在文件夹dist 中创建

    NOTE : verified on windowns, not on mac

    【讨论】:

    • OP要在mac上创建exe,请正确看问题
    • @Nordle,根据Pyinstallerdocumentation应该是可以的:PyInstaller runs in Mac OS X 10.7 (Lion) or newer. It can build graphical windowed apps (apps that do not use a terminal window). PyInstaller builds apps that are compatible with the Mac OS X release in which you run it, and following releases. It can build 32-bit binaries in Mac OS X releases that support them.
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多