title: Tesseract OCR on AWS Lambda via virtualenv
body: <p>I have spent all week attempting this, so this is a bit of a hail mary.</p>
  
  <p>I am attempting to package up Tesseract OCR into AWS Lambda running on Python (I am also using PILLOW for image pre-processing, hence the choice of Python).</p>
  
  <p>I understand how to deploy Python packages onto AWS using virtualenv, however I cannot seem to find a way of deploying the actual Tesseract OCR into the environment (e.g. /env/) </p>
  
  <ul>
  <li>Doing <code>pip install py-tesseract</code> results in a successful deployment of the python wrapper into /env/, however this relies on a separate (local) install of Tesseract</li>
  <li>Doing <code>pip install tesseract-ocr</code> gets me only a certain distance before it errors out as follows which I am assuming is due to a missing leptonica dependency. However, I have no idea how to package up leptonica into /env/ (if that is even possible)</li>
  </ul>
  
  <blockquote>
  <pre><code>tesseract_ocr.cpp:264:10: fatal error: 'leptonica/allheaders.h' file not found
  #include "leptonica/allheaders.h"
  </code></pre>
  </blockquote>
  
  <ul>
  <li>Downloading 0.9.1 python-tesseract egg file from 
  <a href="https://bitbucket.org/3togo/python-tesseract/downloads" rel="noreferrer">https://bitbucket.org/3togo/python-tesseract/downloads</a> and doing easy_install also errors out when looking for dependencies</li>
  </ul>
  
  <blockquote>
  <pre><code>Processing dependencies for python-tesseract==0.9.1
  Searching for python-tesseract==0.9.1
  Reading https://pypi.python.org/simple/python-tesseract/
  Couldn't find index page for 'python-tesseract' (maybe misspelled?)
  Scanning index of all packages (this may take a while)
  Reading https://pypi.python.org/simple/
  No local packages or download links found for python-tesseract==0.9.1
  </code></pre>
  </blockquote>
  
  <p>Any pointers would be greatly appreciated. </p>