I'm trying to compile a Python 3.3 script using cx_Freeze. The script uses win32com.client to control MediaMonkey. This works perfect when I directly run it. But when I compile it, it throws this exception.
Traceback (most recent call last):
File "O:\Python\3\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in <module>
exec(code, m.__dict__)
File "test.py", line 6, in <module>
sdb = win32com.client.DispatchWithEvents("SongsDB.SDBApplication", MMEventHandler)
File "O:\Python\3\lib\site-packages\win32com\client\__init__.py", line 260, in
DispatchWithEvents
clsid = disp_class.CLSID
AttributeError: 'NoneType' object has no attribute 'CLSID'
It doesn't even work when I try to compile a really short script which uses win32com.client:
import win32com.client
class MMEventHandler:
pass
sdb = win32com.client.DispatchWithEvents("SongsDB.SDBApplication", MMEventHandler)
And this is my setup.py script:
from cx_Freeze import setup, Executable
includes = []
excludes = []
packages = ['win32com', 'shlex', 'os', 'pythoncom', 'base64', 'tornado']
filename = "test.py"
setup(
name = 'Test',
version = '0.1',
description = 'test',
author = 'no',
author_email = '[email protected]',
options = {'build_exe': {
'excludes':excludes,
'packages':packages,
'includes':includes
}},
executables = [Executable(filename, base = None, icon = None)])
win32com.gen_pypackage when you freeze it. Let me know if that helps.