import pytesseract as pt
from PIL import Image
img = Image.open("C:/Users/Abir Khan/Desktop/IIT B/Untitled.png")
text = pt.image_to_string(img)
print(text)
Asked
Active
Viewed 404 times
-1

Eran Moshe
- 3,062
- 2
- 22
- 41

Abir Khan
- 11
- 2
- 4
-
1Do post the traceback (error) you're getting – Eran Moshe Feb 13 '20 at 10:06
-
OS version? `Python` version? `pip` version? `PIL` or `Pillow`, and what version? How did you install `PIL`? – phd Feb 13 '20 at 15:09
2 Answers
1
OS: MacOS Catalina 10.15.7 pip version: 20.2.4 requirements.txt: Pillow==2.8.1
Upgrading Pillow via pip install --upgrade Pillow
to version 8.0.1
worked for me perfectly.
I have tried several different approaches like installing zlib
and lzlib
through brew
but nothing worked.

vsobotka
- 153
- 6
0
It likely only needs the zip decoder to save the jpeg. I think I needed to follow these steps in OS X to preview jpegs.
this might help.

Gaurav Shimpi
- 21
- 1
- 7