Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytesseract.pytesseract.TesseractNotFoundError #4759

Closed
abhay-lal opened this issue May 20, 2022 · 2 comments
Closed

pytesseract.pytesseract.TesseractNotFoundError #4759

abhay-lal opened this issue May 20, 2022 · 2 comments

Comments

@abhay-lal
Copy link

Summary

pytesseract.pytesseract.TesseractNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).

pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.

Steps to reproduce

Code snippet:
import pytesseract
plate = pytesseract.image_to_string(threshold, config='-c tessedit_char_whitelist=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ --psm 8')

(Please provide a code snippet! This will help expedite us finding and solving the problem.)

Debug info

Requirements.txt is given below
imutils==0.5.4
numpy==1.21.2
opencv-python-headless
Pillow==9.0.0
streamlit==1.6.0
tesseract
pytesseract

Additional information

Tesseract not found error pops up in Streamlit when I try to run any function of pytesseract.On local device the same error is fixed by adding a path to the tesseract library but on Streamlit tat can not be done as the backend server where the library is being imported from path is not public.

@abhay-lal abhay-lal added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels May 20, 2022
@snehankekre
Copy link
Collaborator

Hi @abhay-lal,

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 line:

    tesseract-ocr
    
  2. The first line installs the base tesseract-ocr application and supports only English by default. To support other languages, you need to install a language specific tesseract data file, which you can do in subsequent lines in packages.txt.

  3. Reboot your app

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

@snehankekre snehankekre removed type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels May 23, 2022
@abhay-lal
Copy link
Author

Thankyou, this helped me fix the issue @snehankekre !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants