title: Getting 'OSError: [Errno 2] No such file or directory' on popen when trying to run mypy
body: <p>Hello stack overflow users,</p>
  <p>I'm having a great deal of difficulty trying to get mypy to work correctly with Popen. Essentially I'm writing a test suite that utilizes mypy but cannot seem to get valid output on my build machine.</p>
  <p>The line in question is the following:</p>
  <p><code>p = subprocess.Popen(['mypy'] + extra_args + python_files, env=my_env, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIP)</code></p>
  <p><code>extra_args</code> specifies the cache-dir and traceback, and <code>python_files</code> are the files in question to be tested. I'm fairly confident that neither of these arguments are the issue, as I've played around with these and made no progress.</p>
  <p>This file is in a git repo, and I've cloned it and put it on a build box. Locally it's not a problem -- I get valid, mypy output indicating errors. However, on my build machine I get the <code>OSError: [Errno 2] No such file or directory</code> error. The full error message is as follows:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;mypath/run_mypy.py&quot;, line 83, in &lt;module&gt;
      main()
    File &quot;mypath/run_mypy.py&quot;, line 70, in main
      p = subprocess.Popen(['mypy'] + extra_args + python_files, env=my_env, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
    File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 711, in __init__
      errread, errwrite)
    File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 1343, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  myotherpath/build-stack.mk:162: recipe for target 'mypy' failed
  </code></pre>
  <p>I've tried adding <code>shell=True</code> but this resulted in all mypy errors begin suppressed, plus is considered bad style/security concern.</p>
  <p>My guess/thought is that maybe mypy somehow isn't in the path that popen uses without the shell but I'm really not sure.</p>