Creating a stand alone Python Service (win32)

Peter Hansen peter at engcorp.com
Sun Apr 20 10:15:31 EDT 2003


Michael Steuer wrote:
> 
> I tried to register the PythonService.exe on the client, but (after adding
> the DLLs it needs) I got the following message when running
> "PythonService.exe /register" (enclosed in *'s to separate it from the rest
> of this message):
> 
> *********************************
> Registering the Python Service Manager ...
> 'import site' failed; use -v for traceback
> *********************************

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 site.py.  It's just a warning though, not
a serious failure, unless something later depends on site.py
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 site.py 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....

-Peter




More information about the Python-list mailing list