【问题标题】:Bundling 32-bit python with py2app application on Mac OS X 10.6在 Mac OS X 10.6 上将 32 位 python 与 py2app 应用程序捆绑在一起
【发布时间】:2014-07-01 19:30:55
【问题描述】:

我正在尝试在 Mac OS X 10.6 服务器上将 python 应用程序与 wxPython GUI 捆绑在一起,以便能够在以后的 Mac OS X 版本上分发它。

我遇到的问题是我无法让 py2app 将 32 位 python 可执行文件与应用程序捆绑在一起,或者强制 python 以 32 位运行。

我试过跑步:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

但它只适用于直接用python运行应用程序,而不是在运行py2app之后。我还尝试使用带有 LSArchitecturePriority 选项的 plist,尝试使用 -prefer-ppc 之类的标志,但似乎没有任何效果。我还尝试从网上下载 2.6 版本的 Python,但我不知道如何使用它来捆绑 32 位 py2app 应用程序(从 altgraph 导入兼容性时出现错误)。

我不断收到 no 64-bit architecture found 错误。我该如何解决这个问题?

【问题讨论】:

    标签: macos 32-bit py2app


    【解决方案1】:

    使用 py2app 选项 --arch=fat 这将从嵌入式 python 解释器中剥离 64 位代码。 您也可以将选项放在 setup.py 文件中。

    https://pythonhosted.org/py2app/options.html

    https://pypi.python.org/pypi/py2app/

    py2app 0.6.4

    Added option '--arch=VALUE' which can be used to select the set of architectures for the main executable. This defaults to the set of architectures supported by the python interpreter and can be used to drop support for some architectures (for example when you're using a python binary that supports both 32-bit and 64-bit code and use a GUI library that does not yet work in 64-bit mode).
    
    Valid values for the argument are archectures used in the list below and the following groups of architectures:
        fat: i386, ppc
        fat3: i386, x86_64, ppc
        univeral: i386, x86_64, ppc, ppc64
        intel: i386, x86_64
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-08
      • 2011-04-21
      • 2018-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-08
      • 2011-11-02
      相关资源
      最近更新 更多