From: Mark H. <ski...@gm...> - 2012-08-14 00:10:46
|
You should probably remove one of the lines in: >> typelibs = [ >> ('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 0), >> ('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 0), as they are identical - although I doubt that is the source of the problem. Next, check that the C866...py file in your gen_py directory is for the COM object you think it is - you should find all the objects and methods you expect to use there. Finally, check that py2exe is doing the right thing with the typelibs - you should see a message printed regarding the typelibs when things are built, and you should be able to find the files, along with a dicts.dat, in the generated .zip file. If all else fails, try adding something like: import win32com.client.gencache print "gen path", win32com.__gen_path__ print "is zip", "win32com.client.gencache.is_zip and let me know what it says. Mark On 13/08/2012 11:28 PM, nikhil jain wrote: > Sorry should have mentioned. > The error I get on running the the compiled exe are as follows: > > Exception in thread Thread-1: > Traceback (most recent call last): > File "threading.pyc", line 530, in __bootstrap_inner > File "threading.pyc", line 483, in run > File "speechplay.py", line 100, in saythread > File "pyttsx\__init__.pyc", line 39, in init > File "pyttsx\engine.pyc", line 45, in __init__ > File "pyttsx\driver.pyc", line 66, in __init__ > File "pyttsx\drivers\sapi5.pyc", line 37, in buildDriver > File "pyttsx\drivers\sapi5.pyc", line 46, in __init__ > File "win32com\client\__init__.pyc", line 317, in WithEvents > AttributeError: 'NoneType' object has no attribute 'CLSID' > > > > > On Mon, 13 Aug 2012 14:35:29 +0530, nikhil jain <nik...@gm...> wrote: > >> Here is my complete script: pastebin.com/LWUSU3cc . Its a simple text to >> speech app, that uses pyttsx and threading features. >> >> Now I want to package into a exe. But am having troubles with this. >> >> This is my setup.py file. >> >> #COMPILE python setup.py py2exe --includes pyttsx.drivers.sapi5 >> from distutils.core import setup >> import py2exe >> py2exe_options = dict( >> includes = "pyttsx.drivers.sapi5", >> typelibs = [ >> ('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 0), >> ('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 0), >> ] >> ) >> setup(console=['speechplay.py']) >> >> >> I got the typelibs from gen_py folder, which looks like this: >> http://i.imgur.com/bnpnJ.jpg . >> To be honest , I have no idea what modules to include . >> Kindly help >> >> Thanks >> Nikhil > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > |