How to force py2app to run the application in 32-bit mode

I am trying to create an application package with py2app on Mac OS X 10.6. The application uses some libraries that are compiled for 32-bit only, so when the application starts, there is an incorrect 64-bit ImportError architecture. How can I tell py2app to make the application run in 32-bit mode?

+4
source share
5 answers

One way is to use only 32-bit Python, such as the 32-bit versions downloaded from python.org, with py2app. Another is to install LSArchitecturePriority on i386 and possibly ppc in the generated Info.plist application package. See here for more information.

+5
source

If you want to work only in 32-bit mode, you do not need a 64-bit architecture. Thus, you can simply remove all architectures without i386 from your resulting application package using the ditto utility.

Example:

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

Your application suite will be smaller and run as a 32-bit application, even on Intel 64-bit systems.

Manually: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/ditto.1.html

Or just run in terminal: man ditto

+6
source

After severe pain and trying to get wx-work, I managed to get it to work using this method, I also included the versions that I installed. It was the only one that worked for me, I hope this helps other people.

 py2applet --arch=i386 -i (includes here) --make-setup (pythonfiles, icon) 

Mine looks a bit like this

 py2applet --arch=i386 -i wx, platform --make-setup print.py print.icns convert.py 

I installed python2.7 using
wxPython2.8-OSX-unicode-py2.7
Setuptools-0.6c11-py2.7.egg
and then

 sudo easy_install-2.7 py2app 

This installed version 0.6.4 py2applet

+4
source

Well, seeing me working in the same office on Webjorn, this may be the best place to post an answer, so we'll find it again. Given the py2app parameter dictionary:

 options = {} ... options['plist'] = { "LSArchitecturePriority": [ "i386" ] } ... setup(options={'py2app':options}) 

This creates an array of a single string value for the LSArchitecturePriority key.

+1
source

You need to get python to work in 32-bit mode.

0
source

Source: https://habr.com/ru/post/1240561/


All Articles