Python (win32serviceutil) & multiprocessing module - file not found

453 Views Asked by At

I have a Python 3.4 application which uses cherrypy for servicing rest calls. I had adapted this code to run as a Windows service using and within one of the modules, the win32serviceutil.ServiceFrameworkmultiprocessing module is used.

Unfortunately, I am getting a file not found exception when the process.run is invoked:

07/30/2017 17:11:18 Traceback (most recent call last):
  File "C:\workspace\demo_v\demo\cherrypy_interface\study_hook.py", line 141, in run
    t.start()
  File "c:\python34\Lib\multiprocessing\process.py", line 105, in start
    self._popen = self._Popen(self)
  File "c:\python34\Lib\multiprocessing\context.py", line 212, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "c:\python34\Lib\multiprocessing\context.py", line 313, in _Popen
    return Popen(process_obj)
  File "C:\workspace\demo_v\demo\cherrypy_interface\demo_hook.py", line 46, in __init__
    super(_Popen, self).__init__(*args, **kw)
  File "c:\python34\Lib\multiprocessing\popen_spawn_win32.py", line 49, in __init__
    None, None, False, 0, None, None, None)
FileNotFoundError: [WinError 2] The system cannot find the file specified

I am not entirely sure which file it cannot locate nor how to get round the issue. I do know that if I run the this application without using a windows service, it runs as expected, so I'm assuming the issue is specific to win32serviceutil.ServiceFramework and the multiprocessing module.

Other items of note are,

  1. I am using virtualenv
  2. I am running this on Windows Server 2012 R2.

Any suggestions would be welcome.

0

There are 0 best solutions below