AttributeError: 'module' object has no attribute 'subscribe' Python
Question: I'm Using `Kubuntu 13.10 64 bit` and `Python 2.7.5+` and `wxPython 2.8.12.1`.
I'm trying to use the `wx.lib.pubsub` module to update `wx.Gauge` from
different class (thread class). I have in my code such imports:

    
    
    try:
        from pubsub import pub
    except ImportError:
        from wx.lib.pubsub import pub
    

but when I start my application, I'm getting the error:

    
    
        pub.subscribe(self.updateProgress, "update")
    AttributeError: 'module' object has no attribute 'subscribe'
    

What's wrong and how to fix it?


Answer: wxPython 2.8.12 contains an older version of pubsub.

In your code it is not clear which version you error on, in other words which
import worked? I guess it is the one from wx.lib which with 2.8.12 would be
the old version of pubsub.

I would suggest to use either a newer version of wxPython, e.g. 3.0.2 or use
the stand alone pypubsub, but if you want to stick with 2.8 then the doc shows
you what needs to be done.
<http://pubsub.sourceforge.net/usage/howtos/upgrade_v1tov3.html#label-upgrade-
for-wx>

