Tesseract is not installed or it's not in my PATH

Hello!
I deployed my Streamlit app and it didn’t show any error in the “manage app” terminal, but when I try to use my app it shows an error saying that Tesseract is not installed, or it’s not in my way. Could you help me solve this?
app: https://share.streamlit.io/guilhermedonizetti/ocr_python/main.py
git repo: GitHub - guilhermedonizetti/OCR_Python: Aplicação em Python para Optical Character Recognition (OCR), uma técnica para extrair textos em imagens. Adicionalmente, o programa tenta encontrar padrões (CPFs e datas) e analisar a quantidade de palavras boas e más.

3 Likes

Hi @guilhermedonizetti, welcome to the Streamlit community!! :wave: :partying_face:

The installation instructions for pytesseract say that Google’s tesseract-ocr is a dependency. Meaning, you need to install tesseract-ocr as an apt-get dependency (for Linux applications outside the Python environment).

The way to do that is to include the necessary dependencies in a packages.txt file in your repo:

  1. Create a new packages.txt file with the following lines:

    tesseract-ocr
    tesseract-ocr-por
    
  2. The first line installs the base tesseract-ocr application and supports only English by default. To support Portuguese, you need to install a language specific tesseract data file, which we do in the second line.

  3. Reboot your app

Once you make the above changes, your app should successfully deploy! :tada:

Happy Streamlit’ing! :balloon:
Snehan

5 Likes

@snehankekre it worked correctly, perfect.
Thank you very much!! :smiley:

1 Like

Hi there!

I’ve run into the same issue and the solution above doesn’t work for me. All the code worked before I deployed the app (I could extract text from images). However, once I deployed the app, the part with tesseract stopped working (it displays the same issue as the person above had).

git repo: GitHub - AkmOleksandr/App
app: https://akmoleksandr-app-summarizerai-bge19e.streamlit.app/

I would really appreciate help,
Thank you in advance.