I have a project which can be installed as Windows Service, but i have troubles getting it done.
Venv is prepared for this project with pywin32 package installed (version 227). However while I am trying to run a python file from console with:
import win32serviceutil
I am getting a following error:
ModuleNotFoundError: No module named 'win32'
Things I tried:
- reinstallation of package, and reinstallation with
python -m pip install pywin32
changing import fashion to:
from win32 import win32serviceutil from win32.lib import win32serviceutil import win32.lib.win32serviceutil as win32serviceutil
Answers from this thread
win32 is recognized as folder by PyCharm:
What is weird, I can run following command and install a Windows Service:
python MyPythonFile.py install
It does not return any errors. However trying to start the service with command:
python MyPythonFile.py start
returns:
"Error 1053: The service did not respond to the start or control request in a timely fashion"
In debug mode python MyPythonFile.py debug
it returns:
ModuleNotFoundError: No module named 'win32serviceutil'