How to solve tesseract-ocr permission denied error for google colab?

Viewed 37

I've been trying to use pytesseract in google colab for a language other than English. After downloading other language packs and moving the files to the corresponding directory (i.e., /usr/share/tesseract-ocr/4.00/tessdata), I have set the TESSDATA_PREFIX environment variable as below.

pytesseract.pytesseract.tesseract_cmd = (
    r'/usr/share/tesseract-ocr/4.00/tessdata'
)

And I encountered the error [Errno 13] Permission denied: '/usr/share/tesseract-ocr/4.00/tessdata'. So I've been searching for solutions and tried !chmod 755 -R /usr/share/tesseract-ocr/4.00/tessdata to permit the access, and it seems not working since I get the same error after.

Have anyone dealt with a similar issue before? Any tips would be really appreciated!

0 Answers
Related