WxPython via py2app: “no matching 64-bit architecture” ERROR, although 32-bit preference set

Using wxPython (the latter) installed on OS X Lion, trying to import wx in the interpreter results in:

  File "wx/__init__.pyc", line 45, in <module> File "wx/_core.pyc", line 4, in <module> File "wx/_core_.pyc", line 18, in <module> File "wx/_core_.pyc", line 11, in __load ImportError: /Users/Pyderman/Downloads/e30356784638/dist/Program.app/Contents/Resources/lib/python2.6/lib-dynload/wx/_core_.so: no appropriate 64-bit architecture 

So, following the instructions given by man python , I install:

 export VERSIONER_PYTHON_PREFER_32_BIT=yes 

and then import wx work (in the interpreter). However, when I associate the program with the OS X application using py2app, the error is repeated, although I try to run the application in the same terminal where I set the environment variable to prefer 32 bits.

I assume that somehow py2app doesn't “know” that 32-bit is preferable? But how to do it, and how can this be implemented or controlled?

+5
source share
1 answer

Let me tell you a little about what Steve C said ... A simple solution would be to install Python 32 bit only from the python site, as Ned offers here

A somewhat more complicated way, but perhaps a more efficient long-term approach, is to set the type of architecture to 32-bit using something like what fviktor offers. This eliminates everything except the i386 architecture, so it will not try to download any of these annoying 64-bit versions.

Source from fviktor:

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

As already mentioned, it removes all 32-bit “things”, which in turn reduce the size of the package and ensure that it never tries to load the 64-bit architecture.

If you want a 32-bit and 64-bit architecture, you could prioritize the architecture to have a 32-bit structure. To do this, edit the Info.plist created by Py2App. Here you have 4 options, ppc, which is a 32-bit powerPC architecture, i386 (most often I assume) a 32-bit architecture, and then two different 64-bit architectures, x86_64 and ppc64.

You can answer your question, but I believe that this is completely different, which can help someone better understand what is happening in the future.

0
source

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


All Articles