I am trying to deploy an application on the Google App Engine that also has OCR function. I downloaded the tesseract using homebrew and using pytesseract
to wrap in Python. The OCR function works on my local system, but it does not when I upload the application to the Google App Engine.
I copied tesseract
folder from usr/local/cellar/tesseract and pasted into the working directory of my app. I uploaded the tesseract files and also pytesseract
files to app engine. I have specified the path for tesseract with os.getcwd()
so that pytesseract
can find it. Nevertheless, this does not work. App engine cannot find the file to execute, since they are not in the same directory (os.getcwd()
) .
Code from pytesseract.py
cmda = os.getcwd()
# CHANGE THIS IF TESSERACT IS NOT IN YOUR PATH, OR IS NAMED DIFFERENTLY
def find_all(name, path):
result = []
for root, dirs, files in os.walk(path):
if name in files:
result.append(os.path.join(root, name))
return result
founds = find_all("tesseract",cmda)
tesseract_cmd = founds[0]
The error from Google App Engine is:
tesseract is not installed on your path.