Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force py2app to run app in 32-bit mode

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?

like image 720
Luke McCarthy Avatar asked Dec 05 '22 20:12

Luke McCarthy


2 Answers

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:

ditto --rsrc --arch i386 YourApplication.app YourApplicationStripped.app

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

like image 53
fviktor Avatar answered Dec 26 '22 14:12

fviktor


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 to i386 and possibly ppc in the generated app bundle's Info.plist. See here for more info.

like image 38
Ned Deily Avatar answered Dec 26 '22 14:12

Ned Deily