Creating a stand alone Python Service (win32)

Michael Steuer news1NOSPAM at
Tue Apr 22 05:18:13 CEST 2003


:: Are you certain that it didn't work anyway?  That message comes when
:: the python.exe (or your service?) is run in a context where it is
:: unable to find the file  It's just a warning though, not
:: a serious failure, unless something later depends on
:: and its normal functioning.
:: (To see this in action, set PYTHONHOME somewhere incorrect, then
:: run python using the full path.)
:: If you want to make it go away, you might be able to include a
:: dummy in your package, or perhaps somehow invoke the -S
:: option on startup, although to be honest I'm not sure how all
:: this interacts with py2exe so at this point I'm rambling....

You are right, it is working anyway.

I was trying to start the service with a batch file, but it seems that the
service created with py2exe can't be started with "<servicename> -start"
(py2exe allows "-install" and "-remove"), but even though it doesn't really
know the "start" option, it still says "... Starting service - this may take
several seconds - please wait ... Could not start the service - error 997".

That was what made me think that the service is not working and given the
message I got when registering PythonService.exe, I thought it was caused by

After seeing your message, I tried again and used the Service Management
Console to start the service and everything worked just fine. I should have
use "net start <servicename>" in my batch file form the start. That would
have saved me a lot of trouble.

Thanks for pointing out that the message I got was simply a warning and I
appologize for not checking this properly before I asked this question in
the first place !



PS: remove NOSPAM from my reply address to get my actual email address.

More information about the Python-list mailing list