centos環境下 pytesseract.image_to_string() 發生OSError: [Errno 2] No such file or directory
阿新 • • 發佈:2019-01-14
word = pytesseract.image_to_string(bw)
File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 193, in image_to_string
return run_and_get_output(image, 'txt', lang, config, nice)
File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 140, in run_and_get_output
run_tesseract(**kwargs)
File "/usr/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 111, in run_tesseract
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
經查詢,centos環境下執行:yum install tesseract
安裝tesseract 即可。