Python Forum
[WxPython] PyPubSUb in Python 2.7 - Error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] PyPubSUb in Python 2.7 - Error
#1
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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020