ImportError: cannot import name Publisher When Using py2exe

1. change
from wx.lib.pubsub import Publisher
to
from wx.lib.pubsub import setuparg1 #must be setuparg1! not setupv1. otherwise cause problem: sendMessage() takes exactly 2 arguments (3 given) py2exe
from wx.lib.pubsub import pub
Publisher = pub.Publisher()

2. put this in the setup.py:

from distutils.core import setup
import py2exe

options = {“py2exe”: {“packages”: [‘wx.lib.pubsub’]}}
setup(windows=[{‘script’: ‘controllerGUI_multiThread.py’}],options=options)

This entry was posted in Others. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *