Windows service issue with py2exe

I have successfully converted my python project to a service. When using the usual installation and start / stop options, everything works correctly. However, I want to compile a project using py2exe, which seems to work correctly until you install the EXE as a service and try to start it.

The following error message appears:

  • CherryPyService starter service
  • Error starting the service: the service did not respond to the start or control request in a timely manner.

My compiled python file (which links to the main project) is as follows:

  • from import settings distutils.core
  • import py2exe

  • Setup (console = ['webserver.py'])

Any help would be greatly appreciated.

+6
python py2exe windows-services
source share
2 answers

The setup.py file should contain

setup(service=["webserver.py"]) 

as shown in the "old" py2exe docs

+4
source share

You will find an example in the py2exe package, look at site-packages \ py2exe \ samples \ advanced.

+1
source share

All Articles