[python-win32] Failure to import zlib in Windows services

Mark Hammond mhammond at skippinet.com.au
Thu Nov 11 01:48:31 CET 2004


Hi Tony,

> I can't import zlib from a script running as a Windows
> service.  If I do,
> this entry appears in the event log:

I suspect you have a zlib.dll in your system32 directory - this is often the
CWD when run as a service.

I really should fix the service implementation to handle this common error.
A quick hack would be something like:

if sys.path[0]=="":
	sys.path[0] = os.path.dirname(__file__)

(or something like that :)

Mark.



More information about the Python-win32 mailing list