[python-win32] pythonservice.exe registration failed used by another process

Jacob Nolan jake at gaynertechnicalservices.com.au
Thu Apr 25 21:29:21 EDT 2024


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
-- 


||
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20240426/66d1bc79/attachment.html>


More information about the python-win32 mailing list