在Mac OS X 10.6上将32位python与py2app应用程序捆绑在一起

时间:2014-05-13 22:47:40

标签: macos 32-bit py2app

我正在尝试将Mac应用程序与Mac OS X 10.6服务器上的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获取错误导入compat)。

我一直在找到没有64位架构的错误。我怎么能绕过这个?

1 个答案:

答案 0 :(得分: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