Ask coding questions

← Back to all posts
Is Pytesseract actually supported by Repl.it?
Noisewerk

Hi everyone,

I have been trying to run Pytesseract the last few days to no avail, even with the most basic script possible:

There seems to be no one else who has worked on this in Repl.it, which leads me to believe you cannot actually use Pytesseract?

Hope someone knows more about this issue, have a good day and thanks!

Answered by 19wintersp [earned 5 cycles]
View Answer
Voters
linksafe
Intenzi
cyb3rswapp3r
Noisewerk
Comments
hotnewtop
19wintersp

You can use Pytesseract, though you need to install the Tesseract executable. You also need to set the location in pytesseract.pytesseract.tesseract_cmd.

Noisewerk

@19wintersp Yeah but how can you do that in Linux though? I don't believe it's possible

19wintersp

@Noisewerk Run:

Then, in your Python code, do:

Noisewerk

@19wintersp I tried but get a language error:

I've tried to also run "install-pkg tesseract-ocr-eng" but not even that fixes it

19wintersp

@Noisewerk I believe you have to clone Tessdata.

Noisewerk

@19wintersp I've looking at that as well and did the following:

Nevertheless, the same error seems to appear. Maybe the path needs to be changed?

19wintersp

@Noisewerk Oh, I would do:

but you need to add the path to Tessdata to TESSDATA_PREFIX:

If you used git clone, that folder would be "~/Test/tessdata" for a repl called "Test".

Noisewerk

@19wintersp In the end the following steps made it indeed work:

Thank you so much for the help!

blacksmithop

@19wintersp the problem is, the entire tessdata exceeds the repl-it Disk quota

19wintersp

@blacksmithop If that happens, I don't think there's really a way to fix it; sorry.

Intenzi

@Noisewerk can you please specify on the third shell command that you did

19wintersp

@Intenzi What do you mean?

Intenzi

@19wintersp

what does this line do, as I am unable to follow through with it

19wintersp

@Intenzi If you're following their steps, this is what moves the download into the correct folder; just use this:

RYANTADIPARTHI

try pip install Pytesseract, if that doesn't work, then it's probably not available in repl.it

Noisewerk

@RYANTADIPARTHI Yeah, Pytesseract is already installed so it's not that the problem I believe. Guess it is not supported after all although there is the correspondent package. Thanks anyways

RYANTADIPARTHI

@Noisewerk no problem.

Noisewerk

@RYANTADIPARTHI I'm going to leave it open since it does not really solve the problem and maybe a solution is found in the future

linksafe

Thank you very much @RYANTADIPARTHI, it worked.

RYANTADIPARTHI

@linksafe my solution?

linksafe
linksafe

No I can't, I didn't ask this question @RYANTADIPARTHI