当我在docker上部署Flask应用程序时,我收到“ tesseract未安装或不在您的路径中”

时间:2019-07-25 16:39:36

标签: python docker python-tesseract

我正在Docker上部署Flask Web应用程序,并且使用pytesseract。但是,当我尝试运行代码时,得到以下error: tesseract is not installed或它不在您的路径中。在我的dockerfile中,运行pip install pytesseractapt get install tesseract-ocr

首先尝试将pytesseract.pytesseract.tesseract_cmd设置为我的本地环境。

这是我的dockerfile:

FROM ubuntu:18.04
RUN apt-get update \
    && apt-get install tesseract-ocr -y \
    apt-get install tesseract-ocr-eng \
    apt-get install tesseract-ocr-fra \
    python3 \
    #python-setuptools \
    python3-pip \
    && apt-get clean \
    && apt-get autoremove


FROM tiangolo/uwsgi-nginx-flask:python3.7
RUN pip install flask flask-jsonpify flask-restful
RUN pip install numpy
RUN pip install requests
RUN pip install pandas
RUN pip install Pillow
RUN pip install werkzeug

RUN pip install spacy
RUN python -m spacy download fr_core_news_md 

RUN pip install opencv-python
RUN pip install pytesseract
RUN pip install textdistance

ADD . /home/app
WORKDIR /home/app
COPY ./app /app

0 个答案:

没有答案