0

I am using module like pytesseract, textract, pyocr, all with Image modul. After opening .jpg file I can display the file but I just can't read the text from the file. I use three kinds of modules nad all th etime I had the same error: The system cannot find the file specified. I use Python 3.5.

The error is in config of this part of code in pytesseract in config=config) # here is a problem.

Do you have any ideas? I' ve search the internet, I've found some examples like lang='eng'and nothing still works.

Code example with pytesseract module is very simple:

im = Image.open("C:/Temp/Example.jpg")
im.show() # it works
text = pytesseract.image_to_string(im)
print(text)

I also used some attributes and nothing works...

Please let me know if sb knows what is going on.

Cris
  • 11
  • 5
  • try this pyocr.get_available_tools() and check if tesseract is installed properly – Himaprasoon Apr 27 '18 at 07:42
  • When I print it, i get only empty list. So when I want to use e.g get_available_languages() I get also nothing... – Cris Apr 27 '18 at 08:15
  • Add `import pytesseract` and `from PIL import Image` at the beginning. Assuming you installed pytesseract properly it should work. – sawreals Apr 27 '18 at 08:29
  • Of course I've got these two imports above. Nothing works, the axact mistake is: FileNotFoundError: [WinError 2] The system cannot find the file specified – Cris Apr 27 '18 at 08:38
  • Either your `pytesseract` installation is not good or you are not defining the correct path to your image, though I don't think it's the latter since you say the image opens. – sawreals Apr 27 '18 at 08:48
  • I am running into a similar problem and after some searching noticed others complaining about the installation of `pytesseract`. `pip freeze` shows I have the `pytesseract` version 0.2.0 module installed but when I run the python code I recieve an ImportError: No module named 'pytesseract'. – sawreals Apr 27 '18 at 08:51
  • I am sure that the path is correct because the picture opens. I als orestaretd my computer and still nothing works. Maybe I'll try another one pytesseract instalation... I've got 0.1.8 version pytesseract. – Cris Apr 27 '18 at 08:55
  • I guess you only have the tesseract python wrapper and not the tesseract backend. Install from here https://github.com/UB-Mannheim/tesseract/wiki – Himaprasoon Apr 27 '18 at 09:02
  • Probably you may be right. But I have no admin rights, is it possible to install it another way? Is this source code the same https://github.com/tesseract-ocr/tesseract/releases ? – Cris Apr 27 '18 at 09:20

0 Answers0