0
我使用py2exe從我的.py成功創建了一個.exe文件。但是,當我嘗試從exe文件應用程序,我收到此錯誤信息:py2exe導入錯誤
Traceback (most recent call last):
File "StreetSoccer.py", line 13, in <module>
ImportError: cannot import name Publisher
我alredy找到了這個網頁:ImportError: cannot import name Publisher但我使用python2.7。 這裏是我的.py的線,我匯入發佈:
from wx.lib.pubsub import Publisher
希望你能幫助我。
編輯: 我做了這些變化:
# from wx.lib.pubsub import Publisher
from wx.lib.pubsub import setupv1
from wx.lib.pubsub import pub
Publisher = pub.Publisher()
現在我得到這個錯誤信息(py2exe後):
File "StreetSoccer.py", line 14, in <module>
File "wx\lib\pubsub\setupv1.pyc", line 16, in setVersion
File "wx\lib\pubsub\pubsubconf.pyc", line 16, in setVersion
File "wx\lib\pubsub\pubsubconf.pyc", line 70, in setVersion
File "wx\lib\pubsub\pubsubconf.pyc", line 78, in __setupForV1
File "wx\lib\pubsub\pub.pyc", line 24, in <module>
File "wx\lib\pubsub\core\listener.pyc", line 13, in <module>
Import Error: No module named listenerimpl