Python Forum

Full Version: PyPubSUb in Python 2.7 - Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Trying to use the PyPubSub library. When i import the library

from pubsub import pub
i get the following error:

Error:
getDefaultPublisher() -> Publisher: SyntaxError: Invalid syntax
Why can't i import the library? I am using Python 2.7, does it work with this version?

Thanks

Fixed!! Wxpython comes with the latest version of PyPubSub (version 4) which does not support Python 2.x.
Need to uninstall PyPubSub version 4

Output:
pip uninstall PyPubSub
and install version 3

Output:
pip install PyPubSub==3.3.0
The need to change

from pubsub import pub
to

from pubsub import pub as pub
I ahvetn't tested the whole functionality yet but at least i do't get the error anymore