wxpython-users Digest, Vol 6, Issue 106

OK, thanks, that fixes the original error -- but now the program uses
the wrong version of wx (2.8.4 instead of 2.8.7). How can I force
py2app to use the correct version of wx?

Thanks,

Ian

···

On Sun, Aug 17, 2008 at 1:39 PM, Cody Precord wrote:

On Aug 17, 2008, at 9:34 AM, Ian York wrote:

I'm using MacOS10.5.4 and Python2.5.1. My program starts with

import wxversion
wxversion.select("2.8.7")

You can't use wxversion with binary versions of a program that are
bundled by py2app or py2exe. You should do something like the
following to avoid the problem

import sys
if not hasattr(sys, frozen):
    import wxversion
    wxversion.select("2.8.7")

--
Ian York (iayork@iayork.com) <http://www.iayork.com/&gt;
"-but as he was a York, I am rather inclined to suppose him a
very respectable Man." -Jane Austen, The History of England

Ian York wrote:

···

On Sun, Aug 17, 2008 at 1:39 PM, Cody Precord wrote:

On Aug 17, 2008, at 9:34 AM, Ian York wrote:

I'm using MacOS10.5.4 and Python2.5.1. My program starts with

import wxversion
wxversion.select("2.8.7")

You can't use wxversion with binary versions of a program that are
bundled by py2app or py2exe. You should do something like the
following to avoid the problem

import sys
if not hasattr(sys, frozen):
    import wxversion
    wxversion.select("2.8.7")

OK, thanks, that fixes the original error -- but now the program uses
the wrong version of wx (2.8.4 instead of 2.8.7). How can I force
py2app to use the correct version of wx?

Force it in your setup.py. Once the app bundle has been made and includes the version of wxPython that you want then it will use that one when the app bundle is run.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!