如何为Python服务修复'ModuleNotFoundError:'?

时间:2019-07-17 21:46:35

标签: python windows windows-services

模块名称为PService.py
PService_svc_name_)和Reader_svc_display_name_

我使用python PService.py install进行了服务,并显示在services.msc中。

经历了很多不同的建议,几乎花了整整一天的时间进行修复,但是,我无法解决ModuleNotFoundError: No module named 'PService'.

我已经阅读了所有可能找到的资源,其中一些具有相同的错误,但是没有解决方案。

这正在Windows Server 2012 R2上运行,我正在使用Python 3.6。


Y:\>python PService.py debug
Debugging service PService - press Ctrl+C to stop.
Error 0xC000000A - Python could not construct the class instance

<Error getting traceback - traceback.print_exception() failed

(null): (null)

Services:
Windows could not start the Reader on Local Computer. For more information, review the System Event log... refer to service-specific error code 1.

System Event Properties:
The Reader service terminated with the following service-specific error: 
Incorrect function.

Application Event Properties: (Source: Python Service)
Python could not import the service's module 
ModuleNotFoundError: No module named 'PService' 
%2: %3
Event Id: 4

0 个答案:

没有答案