I get this error: [WinError 2] The system cannot find the file specified, only when I use pytesser to do OCR. Here is my code snippet.
from PIL import Image
from pytesseract import *
image = Image.open('pranav.jpg')
print (image_to_string(image))****
Otherwise, when I use PIL to change size of image, I do not get this error.
You don't have to edit any pytesseract files. You can declare the path to your Tesseract installation inside your code like so:
import pytesseract
pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files (x86)/Tesseract-OCR/tesseract'