OCR=Image.open("F:\MEGA\Проекты\PyCharmProjects\SeoClicker\output.gif")
print(image_to_string(OCR))
Pytesseract выдает ошибку
Traceback (most recent call last):
File "F:/MEGA/Проекты/PyCharmProjects/SeoClicker/test.py", line 64, in <module>
print(image_to_string(OCR))
File "D:\python\lib\site-packages\pytesseract-0.2.0-py3.6.egg\pytesseract\pytesseract.py", line 193, in image_to_string
File "D:\python\lib\site-packages\pytesseract-0.2.0-py3.6.egg\pytesseract\pytesseract.py", line 140, in run_and_get_output
File "D:\python\lib\site-packages\pytesseract-0.2.0-py3.6.egg\pytesseract\pytesseract.py", line 111, in run_tesseract
File "D:\python\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "D:\python\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Не удается найти указанный файл
Решение проблемы здесь:
https://www.questarter.com/q/pytesseract-can-39-t-...import pytesseract
import PIL
''' указываем эти два параметра обязательно! '''
pytesseract.pytesseract.tesseract_cmd = "F:/tess/Tesseract-OCR/tesseract.exe"
tessdata_dir_config = '--tessdata-dir "F:/tess/Tesseract-OCR"'
img = PIL.Image.open("test.png")
# обязательно укажите lang='eng'
text = pytesseract.image_to_string(img, config=tessdata_dir_config, lang="eng")
print(text)