winpexpect icon indicating copy to clipboard operation
winpexpect copied to clipboard

pywintypes.error: (2, 'CreateProcess', 'The system cannot find the file specified.')

Open ghost opened this issue 3 years ago • 1 comments

Hi, I'm trying to run the the code:

import sys

if 'linux' in sys.platform:
    my_os = 'linux'
    import pexpect
elif 'win' in sys.platform:
    my_os = 'win'
    import winpexpect

if my_os == 'win':
    command = 'qemu-system-arm -machine .........'
    session = winpexpect.winspawn(command)

And I'm obtaining the following error: Traceback (most recent call last): File "xxxxx.py", line 13, in session = winpexpect.winspawn(command) File "yyyyy\lib\site-packages\winpexpect.py", line 344, in init super(winspawn, self).init(command, args, timeout=timeout, File "yyyyy\lib\site-packages\pexpect.py", line 429, in init
self._spawn (command, args) File "yyyyy\lib\site-packages\winpexpect.py", line 399, in _spawn
res = CreateProcess(python, pyargs, None, None, False, pywintypes.error: (2, 'CreateProcess', 'The system cannot find the file specified.')

How can I solve this? @geertj @wamcvey

ghost avatar Mar 04 '22 11:03 ghost

I've already tried referencing the executable multiple ways:

  • 'C:\Program Files\qemu\qemu-system-arm.exe'
  • 'C:\\Program Files\\qemu\\qemu-system-arm.exe'
  • r'C:\Program Files\qemu\qemu-system-arm.exe'
  • r'C:\\Program Files\\qemu\\qemu-system-arm.exe'
  • ...

And even replacing it with cmd.exe

Nothing changes

raphaelcolcombet avatar Mar 04 '22 12:03 raphaelcolcombet