title: Can't run binary from within python aws lambda function
body: <p>I am trying to run this tool within a lambda function: <a href="https://github.com/nicolas-f/7DTD-leaflet" rel="noreferrer">https://github.com/nicolas-f/7DTD-leaflet</a></p>
  
  <p>The tool depends on Pillow which depends on imaging libraries not available in the AWS lambda container. To try and get round this I've ran pyinstaller to create a binary that I can hopefully execute. This file is named <code>map_reader</code> and sits at the top level of the lambda zip package. </p>
  
  <p>Below is the code I am using to try and run the tool:</p>
  
  <pre><code>command = 'chmod 755 map_reader'
  args = shlex.split(command)
  print subprocess.Popen(args)
  
  command = './map_reader -g "{}" -t "{}"'.format('/tmp/mapFiles', '/tmp/tiles')
  args = shlex.split(command)
  print subprocess.Popen(args)
  </code></pre>
  
  <p>And here is the error, which occurs on the second <code>subprocess.Popen</code> call: </p>
  
  <pre><code>&lt;subprocess.Popen object at 0x7f08fa100d10&gt;
  [Errno 13] Permission denied: OSError
  </code></pre>
  
  <p>How can I run this correctly? </p>