I assume you are using a version of wxPython that is >= 2.8.11.0 ? If so, the wx.lib.pubsub package wx.lib.pubsub changed. This page describes the changes. There is also a thread on the wxPython mailing list here that talks about this.
To make all this work in my project, I did here described below which was part of the aforementioned mailing flow. I summarize below:
The most preferred alternative (i.e. no hacks!) If you can hack it (sorry!) Is to use the same messaging protocol as v1, but in the last API it's called "arg1":
# only in app startup module from wx.lib.pubsub import setuparg1 # in all modules that use pubsub from wx.lib.pubsub import pub as Publisher
and replace any appearance of "Publisher()." by "Publisher." "Publisher()." by "Publisher."
Then in my setup.py script I had to add the following parameters:
options = { "py2exe": {"packages": ['wx.lib.pubsub']} } setup(data_files=data_files, windows=[ {'script': 'btpos.py'], options=options)
Now you can create an executable file using the new pubsub version, but with the old api. You can also check out the new pubsub v3 api. If your project is not too large, you can probably do without too much change.
Casey
source share