TesseractNotFoundError: two docker container python app (docker-compose) TesseractNotFoundError: two docker container python app (docker-compose) docker docker

TesseractNotFoundError: two docker container python app (docker-compose)


You need to install tesseract in your docker image before using it. By default python:3.6.1 image does not have tesseract in it. You need to take ubuntu base image install tesseract and python in it then continue your work.Here is the docker file for the solution:

FROM ubuntu:18.04RUN apt-get --fix-missing update && apt-get --fix-broken install && apt-get install -y poppler-utils && apt-get install -y tesseract-ocr && \    apt-get install -y libtesseract-dev && apt-get install -y libleptonica-dev && ldconfig && apt-get install -y python3.6 && \    apt-get install -y python3-pip && apt install -y libsm6 libxext6

Please adjust the python version as per your requirement.


I had this issue on one of my projects that runs on Docker (a Ubuntu container).
To solve that, I had to:
- install pytesseract via requirements.txt; so it your requirements.txt should contain:

pytesseract  

- you have to install tesseract-ocr. To do that, you have to include the following lines in your dockerfile:

FROM ubuntu:18.04ENV PYTHONUNBUFFERED 1RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:alex-p/tesseract-ocrRUN apt-get update && apt-get install -y tesseract-ocr-all RUN apt-get install -y python3-pip python3-minimal libsm6 libxext6 # To make sure that tesseract-ocr is installed, uncomment the following line.  # RUN tesseract --version