python service 服務沒有及時響應啟動或控制請求


1053錯誤

代碼運行沒有問題后,安裝服務,然而start 的時候出現錯誤 1053:服務沒有及時響應啟動或控制請求(Error 1053: The service did not respond to the start or control request in a timely fashion)

試了幾個網上找到的代碼,都是這個現象,所以應該不是代碼的問題。

后面找到解決方法:

What you need to do is to add the Python27 to SYSTEM PATH, and not to USER PATH, since as a default the python service will get installed as a 'LocalSystem' and so when it attempts to start it uses the SYSTEM PATH variable - that's why you can run it from the command prompt, your USER PATH is right.

python默認安裝是作為LocalSystem,配置的是用戶路徑而不是環境變量,所以需要添加環境變量。

在用戶變量處去掉python路徑,然后在環境變量加入python路徑

C:\Users\zhongjianhui\AppData\Local\Programs\Python\Python36\Lib\site-packages\pywin32_system32;

C:\Users\zhongjianhui\AppData\Local\Programs\Python\Python36\Lib\site-packages\win32;

C:\Users\zhongjianhui\AppData\Local\Programs\Python\Python36\Scripts\;C:\Users\zhongjianhui\AppData\Local\Programs\Python\Python36\

start service成功。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM