Python pytesseract nefunguje

Pavel Hudeček edizon na seznam.cz
Čtvrtek Říjen 12 18:20:02 CEST 2023


Dobrý den všem,

udělal jsem
*pip install pytesseract*
Skončilo to
/Successfully installed pytesseract-0.3.10/

Spustil jsem program:
fromPIL importImage importpytesseract img = Image.open('W130_Final.PNG') 
text = pytesseract.image_to_string(img) print(text)
A výsledek je:
/Traceback (most recent call last)://
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py", 
line 255, in run_tesseract//
//    proc = subprocess.Popen(cmd_args, **subprocess_args())//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\subprocess.py", 
line 800, in __init__//
//    restore_signals, start_new_session)//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\subprocess.py", 
line 1207, in _execute_child//
//    startupinfo)//
//FileNotFoundError: [WinError 2] Systém nemůže nalézt uvedený soubor//
//
//During handling of the above exception, another exception occurred://
//
//Traceback (most recent call last)://
//  File "exp-xls.py", line 4, in <module>//
//    text = pytesseract.image_to_string(img)//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py", 
line 427, in image_to_string//
//    }[output_type]()//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py", 
line 426, in <lambda>//
//    Output.STRING: lambda: run_and_get_output(*args),//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py", 
line 288, in run_and_get_output//
//    run_tesseract(**kwargs)//
//  File 
"C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\pytesseract.py", 
line 260, in run_tesseract//
//    raise TesseractNotFoundError()//
//pytesseract.pytesseract.TesseractNotFoundError: tesseract is not 
installed or it's not in your PATH. See README file for more information./

Příčemž v path je mimo jiné
C:\Users\hudecekp\AppData\Local\Programs\Python\Python37\lib\site-packages\pytesseract\
kde se nachází i soubor pytesseract.py
A readme jsem nenašel.

Zkoušel jsem restartovat počítač a taky nepomohlo. Ostatní asi 4 věci co 
jsem dnes instaloval přes pip normálně fungují

Nějaké nápady?

Díky,
PH
------------- další část ---------------
HTML příloha byla odstraněna...
URL: <http://list.hw.cz/pipermail/hw-list/attachments/20231012/29dc168e/attachment.htm>


Další informace o konferenci Hw-list