1
$\begingroup$
pytesseract.pytesseract.tesseract_cmd = r'/usr/local/bin/pytesseract'
img = Image.open("/content/drive/My Drive/abc.jpg")
print(pytesseract.image_to_string(img))

stacktrace:

--> print(pytesseract.image_to_string(img))

sr/local/lib/python3.6/dist-packages/pytesseract/pytesseract.py in image_to_string(image, lang, config, nice, output_type, timeout) 346 Output.DICT: lambda: {'text': run_and_get_output(*args)}, 347 Output.STRING: lambda: run_and_get_output(*args), --> 348 }output_type 349 350

/usr/local/lib/python3.6/dist-packages/pytesseract/pytesseract.py in () 345 Output.BYTES: lambda: run_and_get_output(*(args + [True])), 346 Output.DICT: lambda: {'text': run_and_get_output(*args)}, --> 347 Output.STRING: lambda: run_and_get_output(*args), 348 }output_type 349

/usr/local/lib/python3.6/dist-packages/pytesseract/pytesseract.py in run_and_get_output(image, extension, lang, config, nice, timeout, return_bytes) 256 } 257 --> 258 run_tesseract(**kwargs) 259 filename = kwargs['output_filename_base'] + extsep + extension 260 with open(filename, 'rb') as output_file:

/usr/local/lib/python3.6/dist-packages/pytesseract/pytesseract.py in run_tesseract(input_filename, output_filename_base, extension, lang, config, nice, timeout) 232 with timeout_manager(proc, timeout) as error_string: 233 if proc.returncode: --> 234 raise TesseractError(proc.returncode, get_errors(error_string)) 235 236

TesseractError: (2, 'Usage: pytesseract [-l lang] input_file')

$\endgroup$
  • 1
    $\begingroup$ Duplicate of: stackoverflow.com/questions/54725151/… $\endgroup$ – Peter Dec 27 '19 at 12:41
  • $\begingroup$ @Peter the solution provided over the link that you shred is not working still getting same error. $\endgroup$ – Aj_MLstater Dec 27 '19 at 13:16
  • $\begingroup$ Nevertheless, your question should be posted on SO. $\endgroup$ – Peter Dec 27 '19 at 13:17
  • $\begingroup$ @peter may i know what is SO ? why should it be posted there ? $\endgroup$ – Aj_MLstater Dec 27 '19 at 13:18
  • $\begingroup$ stackoverflow.com $\endgroup$ – Peter Dec 27 '19 at 13:20