python subprocess.call() cannot find Windows Bash.exe
<p>I have a program that gets output from another program which runs on the new windows subsystem for linux.  I have written a python program that runs from the windows system, but will execute the linux program using python subprocess module.  If this is confusing see the example below.</p>

<p>However, when I do this I find that when called through python subprocess, windows cannot find bash program.</p>

<p>example on the commandline or powershell in windows:</p>

<pre><code>C:\&gt;bash -c "echo hello world!"
hello world!

C:\&gt;python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import subprocess as s
&gt;&gt;&gt; s.call('bash -c "echo hello world"'.split())
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "c:\Python27-32\lib\subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\Python27-32\lib\subprocess.py", line 711, in __init__
    errread, errwrite)
  File "c:\Python27-32\lib\subprocess.py", line 948, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

&gt;&gt;&gt; s.call('bash -c "echo hello world"'.split(),shell=True)
    'bash' is not recognized as an internal or external command,
    operable program or batch file.
    1
</code></pre>

<p>I thought maybe it wasn't loading my path settings somehow so I put in the full address of the bash program.</p>

<pre><code>&gt;&gt;&gt; s.call(b,shell=True)
'C:\Windows\System32\bash.exe' is not recognized as an internal or external command,
operable program or batch file.
1
</code></pre>

<p>EDIT :  I realize my command might be giving a problem since o am splitting on spaces and the "echo hello world" is one argument, but trying the same thing with <code>bash -c ls</code> also gives the same error </p>