Hi, I am using opencv and tesseract .the code is working fine in local machine
But when I deploy the app in streamlit cloud it displays the below error
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).
Traceback:
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.__dict__)File "/mount/src/ocrapp/app.py", line 100, in <module>
text = text_extract(img, option1, slang, dlang)File "/mount/src/ocrapp/app.py", line 78, in text_extract
text = pytesseract.image_to_string(gray, lang=lan)File "/home/adminuser/venv/lib/python3.9/site-packages/pytesseract/pytesseract.py", line 423, in image_to_string
return {File "/home/adminuser/venv/lib/python3.9/site-packages/pytesseract/pytesseract.py", line 426, in <lambda>
Output.STRING: lambda: run_and_get_output(*args),File "/home/adminuser/venv/lib/python3.9/site-packages/pytesseract/pytesseract.py", line 288, in run_and_get_output
run_tesseract(**kwargs)File "/home/adminuser/venv/lib/python3.9/site-packages/pytesseract/pytesseract.py", line 260, in run_tesseract
raise TesseractNotFoundError()
and for some images it is also showing the below error
cv2.error: 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).
Traceback:
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
exec(code, module.__dict__)File "/mount/src/ocrapp/app.py", line 100, in <module>
text = text_extract(img, option1, slang, dlang)File "/mount/src/ocrapp/app.py", line 77, in text_extract
gray = preprocess(img)File "/mount/src/ocrapp/app.py", line 71, in preprocess
gray = cv2.cvtColor(img_np, cv2.COLOR_BGR2GRAY)
link for app: https://3hkf8stzrzvlmwrey5ephp.streamlit.app/
github repo: GitHub - asritha205/ocrapp
please help me resolve this