[python-win32] py2exe problem with ActiveX control

Kerry Oliphant koliphant at qwest.net
Wed Mar 24 16:14:37 EST 2004


I have a number of ActiveX controls that I am using in my program.  I have
been trying to use py2exe to package everything together and I keep getting
the error that "'DispatchBaseClass' is not defined" in the makepy generated
file for one of the activeX controls.  Does anyone have a clue here?


This is my error report:

running py2exe
creating C:\Python23\CETI\build
creating C:\Python23\CETI\build\bdist.win32
creating C:\Python23\CETI\build\bdist.win32\winexe
creating C:\Python23\CETI\build\bdist.win32\winexe\collect
creating C:\Python23\CETI\build\bdist.win32\winexe\temp
*** generate typelib stubs ***
creating C:\Python23\CETI\build\bdist.win32\winexe\temp\win32com
creating C:\Python23\CETI\build\bdist.win32\winexe\temp\win32com\gen_py
Traceback (most recent call last):
  File "setup.py", line 55, in ?
    windows = [easyControl]
  File "c:\python23\lib\distutils\core.py", line 149, in setup
    dist.run_commands()
  File "c:\python23\lib\distutils\dist.py", line 907, in run_commands
    self.run_command(cmd)
  File "c:\python23\lib\distutils\dist.py", line 927, in run_command
    cmd_obj.run()
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 180, in run
    self.typelibs)
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py", line 1061, in
collect_win32com_genpy
    sub_mod = gencache.GetModuleForCLSID(clsid)
  File "C:\Python23\Lib\site-packages\win32com\client\gencache.py", line
232, in GetModuleForCLSID
    __import__(sub_mod_name)
  File
"C:\Python23\CETI\build\bdist.win32\winexe\temp\win32com\gen_py\1D3EA638-885
2-443F-8091-8BC575DEAA72x0x3x0\ExplorerBar.py", line 33, in ?

__import__('win32com.gen_py.1D3EA638-8852-443F-8091-8BC575DEAA72x0x3x0._Expl
orerBar')
  File
"C:\Python23\CETI\build\bdist.win32\winexe\temp\win32com\gen_py\1D3EA638-885
2-443F-8091-8BC575DEAA72x0x3x0\_ExplorerBar.py", line 27, in ?
    class _ExplorerBar(DispatchBaseClass):
NameError: name 'DispatchBaseClass' is not defined



My setup.py file:



from distutils.core import setup
import py2exe
import sys

# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-q")

class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the versioninfo resources
        self.version = "7.7.6"
        self.company_name = "Concepts ETI, Inc."
        self.copyright = "Coppyright 2004"
        self.name = "EASy! Control"


easyControl = Target(
    # used for the versioninfo resource
    description = "EASy! Control Distribution.",
    # what to build
    script = "EasyControl/EasyControlApp.py",
##    other_resources = [(RT_MANIFEST, 1, manifest_template %
dict(prog="test_wx"))],
    icon_resources = [(1, "EasyControl/EasyControlResource/impeller.ico")],
    dest_base = "distEasyControl")


setup(
    options = {"py2exe": {"typelibs":
                          # typelibs for early bound COM
                          [('{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}', 0, 2,
0),  #common controls
                           ('{423968A1-C17C-11D0-9082-0060976CDFDC}', 0, 1,
0),  #Radial
                           ('{1D3EA638-8852-443F-8091-8BC575DEAA72}', 0, 3,
0),  #explorer bar
                           ('{C0A63B80-4B21-11D3-BD95-D426EF2C7949}', 0, 1,
0),  #flexgrid
                           ('{33F4BD9A-1A86-4B1A-92DB-6312C5028315}', 0, 1,
0),  #pro E Graph
                           ('{A189857B-3B4A-45DC-B1A1-E5C436F5CB0C}', 0, 2,
0)   #Splash Panel
                          ],
                          # create a compressed zip archive
                          "compressed": 1,
                          "optimize": 2}},
    # The lib directory contains everything except the executables and the
python dll.
    # Can include a subdirectory name.
    zipfile = "library.zip",
    windows = [easyControl]
    )




More information about the Python-win32 mailing list