How do I tell py2app to use/include 32bit Python (for wxPython)?
Question: I'm using OS X Lion (10.7.3) and I'm trying to write a cross-platform, stand-
alone GUI-based program using `wxPython` and `py2app`.

I tried to use Python 2.7.1 which comes shipped with Lion.

I got the `wxPython2.8` binaries (wxPython2.8-osx-unicode-py2.7).

I installed `py2app` via pip.

This is my little test app:

    
    
    #!/usr/bin/python
    import wx
    app = wx.App()
    frame = wx.Frame(None, -1, 'test.py')
    frame.Show()
    app.MainLoop()
    

This is my `setup.py`:

    
    
    from setuptools import setup
    setup(
        app=["test.py"],
        setup_requires=["py2app"],
    )
    

wxPython 2.8 wants 32-bit mode, so I use the `arch` command:

    
    
    arch -i386 /usr/bin/python2.7 test.py
    

**How do I tell py2app to use/include 32bit Python?**

It is possible to manually exchange the relevant files in the app bundle, but
that's a rather clumsy workaround. I could also use 64bit wxPython2.9, but
there isn't a stable release available yet. Should I switch to `cx_Freeze`?
What is the best practice here?


Answer: If you have 64 bit Python installed, then it will create a 64 bit application.  
If you have 32 bit Python installed, then it will create a 32 bit application.  

If you have both installed, then what is created will depend on where Python
collects it's libraries from, the 32 bit or 64 bit install folders.  
On Windows, this depends on which Python executable is actually run. And this
depends on which is first in your system or user PATH settings.  

When you type **python setup.py** , Windows runs **python.exe** which
python.exe is run from the command line depends on you **PATH** environemnt
variable. Which is run if you douple click **setup.py** in explorer depends on
you file associations with **.py** files.  

You could easily make setup.py ensure the correct is being run by spawning a
32bit python instance from within an arbitrary one.  

