I have a python script that does an operation like this:

```
  temp = tempfile.NamedTemporaryFile(delete=False)
  process = subprocess.Popen(['tesseract', path, temp.name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  process.communicate()

```

This seems to work perfectly file when I execute the script from command line. However, I have a need where my java web-application will be calling this script as an external process. I do that by:

```
    def command = """ /usr/local/bin/python ${myscript} ${arg1} ${arg2} """
    def proc = command.execute()
    proc.waitFor()
    def procOutput = proc?.in?.text

```

**Problem** is that when running the script from he we-app i get an error:

```
  File "/Users/anthony/script.py", line 34, in m
    process = subprocess.Popen(['tesseract', path, temp.name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

```