py2exe windows service problem

╄→尐↘猪︶ㄣ 提交于 2019-12-03 10:58:33

问题


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

You get the following error message:

  • Starting service CherryPyService
  • Error starting service: The service did not respond to the start or control request in a timely fashion.

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

  • from distutils.core import setup
  • import py2exe

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

Any help would be greatly appreciated.


回答1:


You setup.py file should contain

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

as shown in the "old" py2exe docs




回答2:


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



来源:https://stackoverflow.com/questions/996129/py2exe-windows-service-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!