I'm not sure. If I say pexpect.spawn( cmd, env=myenv) I would have thought myenv would be used exclusively, and If the cmd cannot be found by myenv["PATH"] then raise an error. ...Does myenv get merged with the parent ie os.environ? ie if myenv doesn't have a PATH do I still get a PATH in the child? And is that the same for other settings?