wxPython 2.9.4 + py2exe error

Hi all,
  I've just installed the latest wxPython 2.9.4 64 bit, mainly so that
I can get access to the wx.FilePickerCtrl.SetInitalDirectory method
(not that it actually seems to be in the release).

Anyway, the code runs fine just like it used to, but when I used
py2exe to compile everything into an exe, it no longer works due to
this error:

    Traceback (most recent call last):
      File "interface.py", line 6, in <module>
      File "render_controller.pyc", line 10, in <module>
      File "wx\__init__.pyc", line 45, in <module>
      File "wx\_core.pyc", line 187, in <module>
    AttributeError: 'module' object has no attribute 'RA_USE_CHECKBOX'

I noticed that the release notes stated that RA_USE_CHECKBOX has been
removed. What;s going on here?

Thanks!
Luke

I’ve been hunting around in the python site packages, and it appears that the py2exe is using the older version of wxPython.
I don’t know why it is using this or how to change it though :confused:

Hi Luke,

···

On 22/08/2012 16:27, Luke Whitehorn wrote:

Hi all,
   I've just installed the latest wxPython 2.9.4 64 bit, mainly so that
I can get access to the wx.FilePickerCtrl.SetInitalDirectory method
(not that it actually seems to be in the release).

Anyway, the code runs fine just like it used to, but when I used
py2exe to compile everything into an exe, it no longer works due to
this error:

     Traceback (most recent call last):
       File "interface.py", line 6, in <module>
       File "render_controller.pyc", line 10, in <module>
       File "wx\__init__.pyc", line 45, in <module>
       File "wx\_core.pyc", line 187, in <module>
     AttributeError: 'module' object has no attribute 'RA_USE_CHECKBOX'

I noticed that the release notes stated that RA_USE_CHECKBOX has been
removed. What;s going on here?

Not sure if it will help, but make sure to clear "build" and "dist" folders in your setup.py script or before running it, especially important when you change versions.

Werner

That did it, thank you Werner!

I guess it just wasn’t rebuilding stuff as it was already byte-compiled and copied.

···

On Wednesday, 22 August 2012 16:01:07 UTC+1, werner wrote:

Not sure if it will help, but make sure to clear “build” and “dist”
folders in your setup.py script or before running it, especially
important when you change versions.

Werner

Do you have multiple version of wx installed?
If yes then add something along these lines to your setup.py.
import wxversion
wxversion.select(‘2.9’)
see:
Werner

···

Hi Luke,

  On 22/08/2012 17:00, Luke Whitehorn wrote:
    I've been

hunting around in the python site packages, and it appears that
the py2exe is using the older version of wxPython.
I don’t know why it is using this or how to change it though
:confused:

http://wiki.wxpython.org/MultiVersionInstalls

Yeah, I do, but wxversion doesn’t work with py2exe, so I just have to make sure the default package is 2.9.4 :slight_smile:

···

On Wednesday, 22 August 2012 16:05:06 UTC+1, werner wrote:

Hi Luke,

  On 22/08/2012 17:00, Luke Whitehorn wrote:
    I've been

hunting around in the python site packages, and it appears that
the py2exe is using the older version of wxPython.
I don’t know why it is using this or how to change it though
:confused:

Do you have multiple version of wx installed?

If yes then add something along these lines to your setup.py.



import wxversion

wxversion.select('2.9')



see:

[http://wiki.wxpython.org/MultiVersionInstalls](http://wiki.wxpython.org/MultiVersionInstalls)



Werner

Why do you think that?

I have 2.8 and 2.9 installed and 2.9 is the default, but when I build the version of my app I currently distribute I use 2.8 and so I just add these two lines at the beginning of the setup.py

import wxversion
wxversion.select('2.8')

Werner

···

On 22/08/2012 17:11, Luke Whitehorn wrote:

Yeah, I do, but wxversion doesn't work with py2exe,