DIGIT-ARC read-only archive · snapshot: July 23, 2026

Any python expert here ?

3 posts · originally from https://geek.digit.in/community/threads/any-python-expert-here.156982/

cute.bandar
cute.bandar Original post #1
May 14, 2012 at 4:57 PM
I wrote a small script on xp that I want to distribute. So I tried compiling it using py2exe. It compiles, but the resulting exe throws errors when run.

Link to my script:
[Python] import pyttsx import threading from threading import * import datetime imp - Pastebin.com

Here's my attempt at compiling it using py2exe
#COMPILE python setup.py py2exe --includes pyttsx.drivers.sapi5

from distutils.core import setup
import py2exe

setup(windows=['speechplay.py'])

I also tried pyinstaller , which also compiles, but again with errors. I found this patch here to make it work. But have no clue as to how to apply that patch to pyinstaller.

Any help please

Thanks
A
May 17, 2012 at 3:52 PM
and whats the error which executable throws??
cute.bandar
May 21, 2012 at 7:22 PM
The errors thrown by the executable are:
Exception in thread Thread-1:
Traceback (most recent call last):
File "speechplay\build\pyi.win32\speechplay\out01-PYZ.pyz\threading", line 530, in __bootstrap_inner
File "speechplay\build\pyi.win32\speechplay\out01-PYZ.pyz\threading", line 483, in run
File "<string>", line 99, in saythread
File "speechplay\build\pyi.win32\speechplay\out01-PYZ.pyz\pyttsx", line 39, in init
File "speechplay\build\pyi.win32\speechplay\out01-PYZ.pyz\pyttsx.engine", line 45, in __init__
File "speechplay\build\pyi.win32\speechplay\out01-PYZ.pyz\pyttsx.driver", line 64, in __init__
File "D:\py\PyInstaller\loader\iu.py", line 409, in importHook
raise ImportError("No module named %s" % fqname)
ImportError: No module named drivers


Hi,
I was just compiling another python hello world program and .. long story short I think the problem is with my pythonpath. Can I request someone to bare with me and explain me how to set it right ?
i am on xp . And this is the output of echo %pythonpath%
D:\Python27\python27.zip;D:\Python27\DLLs;D:\Python27\lib;D:\Python27\lib\plat-win;D:\Python27\lib\lib-tk;D:\Python27;D:\Python27\lib\site-packages;D:\Python27\lib\site-packages\win32;D:\Python27\lib\site-packages\win32\lib;D:\Python27\lib\site-packages\Pythonwin

Is it correct?
I had pythonpath problems previously as well.
The main warning I get while compiling is this:
WARNING: library python%s%s required via ctypes not found
any ideas /

thanks