Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PythonService was unable to locate the service manager windows 10 #1987

Closed
Haislich opened this issue Dec 7, 2022 · 5 comments
Closed

PythonService was unable to locate the service manager windows 10 #1987

Haislich opened this issue Dec 7, 2022 · 5 comments

Comments

@Haislich
Copy link

Haislich commented Dec 7, 2022

I have a python service which has been running in my local machine for quite a lot now and everything works.
I was ready to transition to my server and I've been facing some issues with the insallation process.
I installed everything accordingly to running as a windows service.

After the installation of the service however the python service stops with error 1053 and with no useful informations.
After some digging I discovered that the problem might be related to the service manager.

When trying to run it in order to register it, which shouldn't be needed, the output is :

PythonService was unable to locate the service manager. Please see the event log for details

Which is weird because everything seems in place to me
Immagine 2022-12-07 123224

The log states:

The description for Event ID 14 from source Python Service cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

<Error getting traceback - traceback.print_exception() failed>

The specified resource type cannot be found in the image file

From the source code of service manager
i couldn't trace back the problem since it seems every problem redirects ultimately to this situation.

  • python version 3.11 pywin version 304
@Haislich
Copy link
Author

Haislich commented Dec 7, 2022

Rolling back to python 3.10.5 solves the issue.

@Haislich Haislich closed this as completed Dec 7, 2022
@JDM-GBG
Copy link

JDM-GBG commented May 10, 2023

I encountered a similar situation, although I received a different error:
https://stackoverflow.com/questions/76174279/module-not-found-error-in-python-script-running-as-a-windows-service

However your fix of reverting to 3.10.x resolved the problem. So it appears there's an incompatibility between Python 3.11 and pywin32, which needs corrected.

@PavelPu
Copy link

PavelPu commented May 31, 2023

I suspect it has something to do not only with Python version, but Windows Server as well.
I can run my service under Win11, but have same error under Win Server 2019

@daniel-airgus
Copy link

This issue seems to persist for 3.10.11 and 3.11.5 is there any way to fix this?

@JDM-GBG
Copy link

JDM-GBG commented Oct 19, 2023

Issue also persists when using Python 3.12. However using an environment built with 3.10.11, I do not get the error. (This is on a machine running Windows Server 2016.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants