I am trying to build an app bundle with py2app on Mac OS X 10.6. The app uses some libraries which are only compiled for 32-bit, so when the app is run there is an ImportError "no appropriate 64-bit architecture". How can I tell py2app to force the app to run in 32-bit mode?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
After lots of pain and trying to get wx working I managed to get it to work using this method, I have also included the versions I installed
This was the only one that worked for me, I hope it helps others..
Mine looks a bit like this
I installed python2.7 with
wxPython2.8-osx-unicode-py2.7
setuptools-0.6c11-py2.7.egg
and then
This installed version 0.6.4 of py2applet
You need to force python to run in 32-bit mode.
If you want to run only in 32 bit mode, then you don't need the 64 bit architecture. So you can just strip out all the non-i386 architectures from your resulting application bundle using the
ditto
utility.Example:
Your application bundle will be smaller and will run as a 32 bit application for sure, even on 64 bit Intel systems.
Manual: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/ditto.1.html
Or just run in a terminal:
man ditto
One way is to use a 32-bit-only Python, such as the 32-bit-only versions downloadable from python.org, with py2app. Another is to set the
LSArchitecturePriority
toi386
and possiblyppc
in the generated app bundle's Info.plist. See here for more info.OK, seeing as I work one office over from Vebjorn, possibly this is the best place to post an answer so we will find it again. Given a dictionary of py2app options:
This creates an array of one string value for the LSArchitecturePriority key.