Problem with a PyInstaller build containing wx\lib\pubsub

I posted the message below to wxPython-dev yesterday via Google
Groups and it immediately deleted it (Any reason why?) . But I
received it as an email because I have asked it to Automatically
subscribe me to email updates when I post to a topic - David

···

On 01/03/2018 16:01, David Hughes
wrote:



I'm experiencing the same problem as reported in:

8006 WARNING: Hidden import "wx.lib.pubsub.core.publisher" not found!
8008 WARNING: Hidden import "wx.lib.pubsub.core.listenerimpl" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.publishermixin" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.datamsg" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.topicargspecimpl" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.topicmgrimpl" not found!
              Apparently the

import of those modules is done in the subfolder
kwargs, but those files actually need to be placed in
the root folder.

              So I just copied

those files from

Lib\site-packages\wx-3.0-msw\wx\lib\pubsub\core\kwargs

to

Lib\site-packages\wx-3.0-msw\wx\lib\pubsub\core

and now IT WORKS!

            Although the above refers to wxPython Classic, the same

occurs in wxPython 4 and copying the files up from
kwargs resolves the problem.I copied rather than moved
them in case pubsub relies on them being in kwargs.

            The current arrangement works fine for wxPython itself,

but in the interests of “good neighbours”, should I
raise this as an issue in Github/Phoenix?

David Hughes

Forestfield Software

  You received this message because you are subscribed to a topic in

the Google Groups “wxPython-dev” group.

  To unsubscribe from this topic, visit [https://groups.google.com/d/topic/wxPython-dev/SdFo2Z-0kbM/unsubscribe](https://groups.google.com/d/topic/wxPython-dev/SdFo2Z-0kbM/unsubscribe).

  To unsubscribe from this group and all its topics, send an email

to wxPython-dev+unsubscribe@googlegroups.com.

  For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

https://stackoverflow.com/questions/40769018/pyinstaller-and-import-issue-with-wx-lib-pubsub

  I posted the message below to wxPython-dev yesterday via Google

Groups and it immediately deleted it (Any reason why?) . But I
received it as an email because I have asked it to Automatically
subscribe me to email updates when I post to a topic - David

It was apparently the first time you had posted to wxPython-dev as it needed to be approved, which I did. Not sure why it would have disappeared.


I'm experiencing the same problem as reported in:
[https://stackoverflow.com/questions/40769018/pyinstaller-and-import-issue-with-wx-lib-pubsub](https://stackoverflow.com/questions/40769018/pyinstaller-and-import-issue-with-wx-lib-pubsub)

8006 WARNING: Hidden import "wx.lib.pubsub.core.publisher" not found!
8008 WARNING: Hidden import "wx.lib.pubsub.core.listenerimpl" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.publishermixin" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.datamsg" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.topicargspecimpl" not found!
8009 WARNING: Hidden import "wx.lib.pubsub.core.topicmgrimpl" not found!
              Apparently the

import of those modules is done in the subfolder
kwargs, but those files actually need to be placed in
the root folder.

              So I just copied

those files from

Lib\site-packages\wx-3.0-msw\wx\lib\pubsub\core\kwargs

to

Lib\site-packages\wx-3.0-msw\wx\lib\pubsub\core

and now IT WORKS!

            Although the above refers to wxPython Classic, the same

occurs in wxPython 4 and copying the files up from
kwargs resolves the problem.I copied rather than moved
them in case pubsub relies on them being in kwargs.

IIRC it’s due to some dynamic imports happening which tools like PyInstaller can’t detect.

            The current arrangement works fine for wxPython itself,

but in the interests of “good neighbours”, should I
raise this as an issue in Github/Phoenix?

It would probably be better to report it upstream at GitHub - schollii/pypubsub: A Python publish-subcribe library (moved here from SourceForge.net where I had it for many years)

···

On Friday, March 2, 2018 at 9:21:40 AM UTC-8, David Hughes wrote:

  On 01/03/2018 16:01, David Hughes > wrote:

Robin Dunn

Software Craftsman
http://wxPython.org

I will do that although looking further into PyInstaller I see it has a powerful mechanism for locating problematic imports via Python scripted “Hooks” and that many such have been published at GitHub - pyinstaller/pyinstaller: Freeze (package) Python programs into stand-alone executables for various Python packages. There is one there for wx.lib.pubsub but looking at the open Issues there have been several, so far unsuccessful attempts to complete it going back several years, in particular, issues #1367, #1530, #2215 and #2233. In the light of this it seems highly unlikely that the stackoverflow solution I quoted earlier will work other than to simply suppress the import errors.

···

On Sunday, March 4, 2018 at 3:07:35 AM UTC, Robin Dunn wrote:


It would probably be better to report it upstream at https://github.com/schollii/pypubsub


David Hughes
Forestfield Software