我正在尝试在 Mac OS X 10.6 Server 上将 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 中收到错误 import compat)。
我不断收到“找不到 64 位架构”错误。我该如何解决这个问题?
最佳答案
使用 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
关于macos - 在 Mac OS X 10.6 上将 32 位 python 与 py2app 应用程序捆绑在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23642872/