0

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

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

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

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)     
4

1 回答 1

3

你在使用 wxPython 中的 activex 吗?顺便说一句,你不应该像这样导入 wx:

from wxPython.wx import *
from wx import *

推荐的方法是

import wx

然后在所有内容前面加上“wx”。wxPython 非常庞大,通过按照自己的方式进行操作,您可以从中导入几乎所有不需要的东西。“wxPython.wx”已经很老了,我不知道为什么还要包含它。绝对不要用那个。

于 2011-07-20T14:05:30.417 回答