all python windows service can not start{error 1053}

南楼画角 提交于 2019-12-03 12:42:39

Had the same problem using pypiwin32 (version: 220) and python (version: 3.6). I had to copy "\Python36-32\Lib\site-packages\pypiwin32_system32\pywintypes36.dll" to "\Python36-32\Lib\site-packages\win32" for the service to start (was working in debug mode)

If:

  • python your_service.py debug works, whilst
  • python your_service.py install + start it as a service fails with error 1053,

this command may help python C:\Python27\Scripts\pywin32_postinstall.py.

all my python coded windows service cannot run on my computer.

but all of them can start at our dev-server which means my code is correct.

but i found a alternative solution, run in debug mode:

any_service.py debug

I had similar problem with a python service and found out that it was missing DLLs since the 'System Path' (not the user path) was not complete. Check the path in your dev-server and whether it matches the one at your computer (System path if service is installed as a LocalSystem service). For me I was missing python dlls' path c:\python27 (windows).

Make sure you run the application with a different user than the default Local System user. Replace it with the user you successfully be able to run the debug command with.

  • To replace the user go to the windows services (start > services.msc)
  • Right click on the service you created > properties > Log On
  • Uncheck the Local System Account and enter your own.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!