启动python Windows Service可执行文件时出错

时间:2019-12-24 10:12:08

标签: python windows-services

我正在按照
的要求制作python Windows服务 https://www.thepythoncorner.com/2018/08/how-to-create-a-windows-service-in-python/直接从python控制台安装的服务运行正常。
但是,当我通过auto-py-to-exe制作可执行文件(用于无python环境的服务器)并通过命令提示符进行安装时,它会安装但出现此错误

windows_service.exe install
Installing service TestService
Changing service configuration
service Updated

windows_service.exe start
Starting service TestService
Error starting service : The service did not respond to the start or control request in timely fashion

windows_service.exe debug


AttributeError: module "servicemanager" has no attribute 'debugging'

仅当.py脚本转换为.exe时才会发生此错误

1 个答案:

答案 0 :(得分:0)

我删除了pip中的模块servicemanager并编辑并运行pyinstaller解决了问题

pip uninstall servicemanager