The syscall to run the process returns an error 2 regardless of whether it's called by the shell or from Python.
In the shell case, it's the shell that then generates the "not recognized" message.
Using subprocess.Popen()
without shell=True
(which you should not use without necessity), no shell is present, so you get the raw error code back yourself.