OSError: [Errno 2] No such file or directory When I use subprocess.Popen in Python
<p>I have a problem with Python when I use subprocess.Popen (in ubuntu). I have a code like this:</p>

<pre><code># This line is just to check if the path are right. 
# I can delete this first Popen but I get always the same error.
out = subprocess.Popen(["ls"], cwd='/home/user/Desktop/',
   stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]

print out

# This line doesn't work
out = subprocess.Popen(["mri_info", "--vox2ras", "orig.mgz"], 
    cwd='/home/user/Desktop/',
    stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]

print out
</code></pre>

<p>The first Popen works very well but the second one no. It gives me this error:</p>

<pre><code>OSError: [Errno 2] No such file or directory
</code></pre>

<p>I'm sure that the path are right and the file orig.mgz is in that directory but... it doesn't work. Can someone help me?</p>