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