[python-win32] PythonService was unable to locate the service manager
Currently experiencing this issue on my Windows machine when installing a Windows Service. This is the error output I get from running in the cmd as administrator. Restricting me from being able to run my services. *- PythonService was unable to locate the service manager. Please see the event log for details.** * Here is the output from event viewer application log: |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: getting traceback - traceback.print_exception() failed> The specified resource type cannot be found in the image file | This issue has happened on each of these version I've tested Python3.11, 3.10.10 and 3.10.8. Currently running Python 3.10.8 64 Bit on Windows Server 2016. - I've installed pywin32 - Run post_install in the root directory of python310 - Installed the service with install flag - Attempted to start service with start flag - PythonService was unable to locate the service manager. Please see the event log for details. -- *Thanks* *Jacob*___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] PythonService was unable to locate the service manager
I performed a custom install for all users on my E: drive (E:/installs/python3). Added it to the path. It is not under my specific user account. My understanding is this is a global install. I then run it under administrator privileged cmd and successfully install the service. Looking at security permissions for pythonservice.exe in the root python directory. SYSTEM and Admin users have full control. *Jacob Nolan* *Gayner Technical Services* Phone: 0437210168 Email: [email protected] On 1/12/24 01:19, Mark Hammond wrote: The "" part sounds like it is failing to find Python itself. Where is Python installed? Is it possible the user running the service can't access that location? I believe Python being installed in the default location could cause this if the server is running as any other other than the user which installed Python. Mark On 2024-01-11 1:20 a.m., Jacob Nolan via python-win32 wrote: Currently experiencing this issue on my Windows machine when installing a Windows Service. This is the error output I get from running in the cmd as administrator. Restricting me from being able to run my services. *- PythonService was unable to locate the service manager. Please see the event log for details.** * Here is the output from event viewer application log: |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: The specified resource type cannot be found in the image file | This issue has happened on each of these version I've tested Python3.11, 3.10.10 and 3.10.8. Currently running Python 3.10.8 64 Bit on Windows Server 2016. - I've installed pywin32 - Run post_install in the root directory of python310 - Installed the service with install flag - Attempted to start service with start flag - PythonService was unable to locate the service manager. Please see the event log for details. -- *Thanks* *Jacob* ___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32
Re: [python-win32] PythonService was unable to locate the service manager
E: is just a local harddrive. The full python install and files under the E: drive is accessible for both the local SYSTEM user, my user and administrator. It is configured to run as the Local System Account. I am successfully able to install the service initially via admin command prompt, and the run it via pywin service debug or using services.msc. But after performing several more service installs I then get this error. It regularly happens and stops any further services from running. I can then reinstall python and it is resolved again. I've asked IT to review any antivirus blocking of files/manipulation of files. They have confirmed there is not. Although I was going to perform checksums on the DLL's and pythonservice.exe. *Jacob Nolan* *Gayner Technical Services* Phone: 0437210168 Email: [email protected] On 1/13/24 02:05, Mark Hammond wrote: On 2024-01-11 5:46 p.m., Jacob Nolan via python-win32 wrote: I performed a custom install for all users on my E: drive (E:/installs/python3). Added it to the path. It is not under my specific user account. My understanding is this is a global install. What exactly is E:? If anything other than a local device it might not be available to the user running the service. I then run it under administrator privileged cmd and successfully install the service. Looking at security permissions for pythonservice.exe in the root python directory. SYSTEM and Admin users have full control. To be clear, the entire Python tree will need those permissions, not just that .exe. And the question is whether the user running the service has access - SYSTEM and Admin should cover many common scenarios, but not all. You could try configuring the service for your specific user just to see if it works - if it does it would still point to user permissions. Mark *Jacob Nolan* *Gayner Technical Services* Phone: 0437210168 Email: [email protected] On 1/12/24 01:19, Mark Hammond wrote: The "" part sounds like it is failing to find Python itself. Where is Python installed? Is it possible the user running the service can't access that location? I believe Python being installed in the default location could cause this if the server is running as any other other than the user which installed Python. Mark On 2024-01-11 1:20 a.m., Jacob Nolan via python-win32 wrote: Currently experiencing this issue on my Windows machine when installing a Windows Service. This is the error output I get from running in the cmd as administrator. Restricting me from being able to run my services. *- PythonService was unable to locate the service manager. Please see the event log for details.** * Here is the output from event viewer application log: |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: traceback.print_exception() failed> The specified resource type cannot be found in the image file | This issue has happened on each of these version I've tested Python3.11, 3.10.10 and 3.10.8. Currently running Python 3.10.8 64 Bit on Windows Server 2016. - I've installed pywin32 - Run post_install in the root directory of python310 - Installed the service with install flag - Attempted to start service with start flag - PythonService was unable to locate the service manager. Please see the event log for details. -- *Thanks* *Jacob* ___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32 ___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32
[python-win32] pythonservice.exe registration failed used by another process
Hi all, I've been having a reoccurring error across multiple windows installs and python versions (3.9.*-3.11.*) when performing an install of a python windows service. This is the result of calling *python service_config.py install *on 3.9.5 The error is: |*copying host exe 'E:\jacobnolan\installed_programs\programs\python39\lib\site-packages\win32\pythonservice.exe' -> 'E:\*|*|jacobnolan||\installed_programs\programs\python39\pythonservice.exe' Error installing service: The process cannot access the file because it is being used by another process. (32)|* For this system, this is not the first python service I have installed. Additionally I've installed multiple services while other python services have been running. As stated in the error it looks to be the destination pythonservice.exe is being used by another process, so can't be replaced by my installing process. Is there an approach to handle this? * I'm not sure if pythonservice.exe really needs to be replaced each install. I was contemplating looking at the service registration process to determine if this step can be skipped. * Or if I should specify the location of the pythonservice.exe now it is in the correct location to access the appropriate DLL's? e.g win32serviceutil service use exeName? o https://github.com/mhammond/pywin32/blob/fcab71452cc8aefeb23b897a03753e34298d555f/win32/Lib/win32serviceutil.py#L215 Thank you, Jacob -- || ___ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32
