wxPython的Pyinstaller Activex属性错误 [英] Pyinstaller Activex Attribute Error with wxPython

查看:153
本文介绍了wxPython的Pyinstaller Activex属性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,当我使用Pyinstaller编译我的应用程序时,它在运行时给我一个错误:

For some reason, when I compile my app with Pyinstaller, it gives me an error when run:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
AttributeError: 'module' object has no attribute 'activex'

还有我的代码的顶部(代码本身非常长).我还删除了顶部的整个数组,其中包含应用程序的文本.

And the top of my code (the code itself is extremely long). I've also removed a whole load of arrays at the top, which contain text for the app.

from wxPython.wx import *
from wx import *
from wx.lib.wordwrap import wordwrap
import sys, os, re

class CheatulousFrame(wxFrame):

    APP_STORAGE = ""
    APP_REGISTERED = False
    APP_WORKING = False

    ## ARRAYS GO HERE

    def __init__(self, parent, ID, title):
        wxFrame.__init__(self, parent, ID, title, (-1, -1), wxSize(600, 300))
        self.Centre()

        self.Bind(EVT_CLOSE, self.quitApp)

        self.getDataPath()
        self.checkRegistered()

        self.menuBar = wxMenuBar()
        self.createMenu(self.file_menu, "File")
        self.createMenu(self.conn_menu, "Connection")
        if self.APP_REGISTERED:
            self.createMenu(self.regt_menu, "Registration")
        else:
            self.createMenu(self.regf_menu, "Registration")
        self.createMenu(self.devt_menu, "Dev Tools")
        self.SetMenuBar(self.menuBar)     

推荐答案

您是否正在使用wxPython中的activex内容?顺便说一句,您不应该这样导入wx:

Are you using the activex stuff from wxPython? By the way, you shouldn't import wx like this:

from wxPython.wx import *
from wx import *

推荐的方法是

import wx

,然后在所有内容前添加"wx". wxPython是巨大的,通过您自己的方式进行操作,您几乎可以从中导入不需要的所有内容. "wxPython.wx"太旧了,我不知道为什么还要包含它.绝对不要使用它.

And then prepend everything with "wx". wxPython is HUGE and by doing it your way, you import almost everything from it, which you don't need. The "wxPython.wx" is super old, I don't know why that's even included any more. Definitely don't use that.

这篇关于wxPython的Pyinstaller Activex属性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆