title: Why can't the Python command "subprocess.Popen" find the jar file to run?
body: <p>I'm trying to run code from this repo: <a href="https://github.com/tylin/coco-caption" rel="nofollow noreferrer">https://github.com/tylin/coco-caption</a>, specifically from <a href="https://github.com/tylin/coco-caption/blob/master/pycocoevalcap/tokenizer/ptbtokenizer.py" rel="nofollow noreferrer">https://github.com/tylin/coco-caption/blob/master/pycocoevalcap/tokenizer/ptbtokenizer.py</a>, line 51-52:</p>
  
  <pre><code>p_tokenizer = subprocess.Popen(cmd, cwd=path_to_jar_dirname, \
              stdout=subprocess.PIPE)
  </code></pre>
  
  <p>The error I get running this is </p>
  
  <pre><code>OSError: [Errno 2] No such file or directory
  </code></pre>
  
  <p>I can't figure out why the file can't be found. </p>
  
  <p>The jar I'm trying to run is: </p>
  
  <pre><code>stanford-corenlp-3.4.1.jar
  </code></pre>
  
  <p>You can see the structure of directory by going to <a href="https://github.com/tylin/coco-caption/tree/master/pycocoevalcap/tokenizer" rel="nofollow noreferrer">https://github.com/tylin/coco-caption/tree/master/pycocoevalcap/tokenizer</a>. For more specificity into what my actual arguments are when I run the line of code: </p>
  
  <pre><code>cmd= ['java', '-cp', 'stanford-corenlp-3.4.1.jar', 'edu.stanford.nlp.process.PTBTokenizer', '-preserveLines', '-lowerCase', 'tmpWS5p0Z'],
  </code></pre>
  
  <p>and </p>
  
  <pre><code>path_to_dirname =abs_path_to_folder/tokenizer
  </code></pre>
  
  <p>I can see the jar that needs to be run, and it looks to be in the right place, so why can't python find it. (Note: I'm using python2.7.) And the temporary File 'tmpWS5p0Z' is where it should be.  </p>
  
  <p>Edit: I'm using Ubuntu</p>