py2exe windows服务问题 [英] py2exe windows service problem

查看:40
本文介绍了py2exe windows服务问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功将我的 python 项目转换为服务.使用通常的安装和启动/停止选项时,一切正常.但是,我希望使用 py2exe 编译该项目,在您将 EXE 作为服务安装并尝试运行它之前,它似乎可以正常工作.

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.

您收到以下错误消息:

  • 启动服务 CherryPyService
  • 启动服务时出错:服务没有及时响应启动或控制请求.

我编译的python文件(链接到主项目)如下:

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

  • 从 distutils.core 导入设置
  • 导入py2exe

  • from distutils.core import setup
  • import py2exe

设置(控制台=['webserver.py'])

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

任何帮助将不胜感激.

推荐答案

您的 setup.py 文件应该包含

You setup.py file should contain

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

"旧" py2exe 文档中所示

这篇关于py2exe windows服务问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆