When trying to import and use wx.pubsub with py2exe I am running into an error.
I know, I know, this topic has many posts, specifically these:
http://wxpython-users.1045709.n5.nabble.com/wx-lib-pubsub-in-wxPython-2-8-11-0-and-py2exe-td2375048.html
http://stackoverflow.com/questions/5374451/importerror-cannot-import-name-publisher
https://groups.google.com/forum/#!msg/wxpython-users/1EikKr2uPmk/MEjue6j82wMJ
https://groups.google.com/forum/#!topic/wxpython-users/1EikKr2uPmk
https://groups.google.com/forum/#!topic/wxpython-users/_DoJkQWuDOg
https://groups.google.com/forum/#!topic/pypubsub/PmU-JCj4h8A
https://groups.google.com/forum/#!topic/wxpython-users/eGw27sCL0yE
I have been through them pretty carefully, trying out the different options, but for the life of me I cannot figure out what is wrong with my set up.
If anyone has any insight it would be greatly appreciated. I don’t have too much experience with py2exe, so I may just have overlooked something simple.
Specifics:
python 2.7
wxpython 2.8.12.1
windows 7
What I have done:
setup.py file:
options = {
“packages”: [“pubsub”],
“includes” : [“wx.lib.pubsub.", "wx.lib.pubsub.core.”, “wx.lib.pubsub.core.arg1.*” ],
}
setup(
name = “acdataloader_controller”,
version = “1.0”,
packages = find_packages(exclude=[".tests", ".tests.", "tests.", “tests”]),
include_package_data = True, # include everything in source control
options=options,
package_data = package_data
)
Note-- I’ve also tried the options flag as this:
options = {“py2exe”:{
“packages”: [“pubsub”],
“includes” : [“wx.lib.pubsub.", "wx.lib.pubsub.core.”, “wx.lib.pubsub.core.arg1.*” ],
}}
Within my Controller/Main/App Entry point I have:
import wx.lib.pubsub.setupv1
(and I have also tried:
import wx.lib.pubsub.setuparg1 )
Then within my classes that use Publisher i have:
from wx.lib.pubsub import pub as Publisher
Within …\wx\lib\pubsub\pubsub1 i have placed a blank init.py file (i also made sure there was one in pubsub2 and core).
However, when I run setup.py py2exe, i am getting the following output:
The following modules appear to be missing
[‘Carbon’, ‘Carbon.Appearance’, ‘Carbon.Files’, ‘_scproxy’, ‘core.publisher’, ‘l
istenerimpl’, ‘publishermixin’, ‘pysqlite2’, ‘topicargspecimpl’, ‘topicmgrimpl’,
‘wx.lib.pubsub.Publisher’]
and not surprisingly when I run the .exe that is created I get the following error –
Traceback (most recent call last):
File “acdataloader_controller.py”, line 12, in
File “Views\home_view.pyc”, line 11, in
File “wx\lib\pubsub\pub.pyc”, line 24, in
File “wx\lib\pubsub\core\listener.pyc”, line 13, in
ImportError: No module named listenerimpl
Does anybody have a similar setup that may have another trick up their sleeve or possibly see something wrong with what I have tried? Having tried multiple things, I’m not sure if maybe I am trying to many solutions at once? Is there another version of wx that won’t have this issue with py2exe, perhaps the most recent release that Robin just announced-- 3.0.0.0? I am at a loss for what to try next, and with an impending due date, I may have to find an alternative to Pubsub (which I obviously don’t want to do). Any help would be great.
Thanks,
Jake