FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'

FileNotFoundError: [Errno 2] No such file or directory: ‘tesseract’

报错问题如下

Traceback (most recent call last):
  File "identCode.py", line 36, in <module>
    print(getCode(sys.argv[1]))
  File "identCode.py", line 25, in getCode
    vcode = pytesseract.image_to_string(image)
  File "/usr/local/lib/python3.5/dist-packages/pytesseract/pytesseract.py", line 161, in image_to_string
    config=config)
  File "/usr/local/lib/python3.5/dist-packages/pytesseract/pytesseract.py", line 94, in run_tesseract
    stderr=subprocess.PIPE)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'

解决方案

安装tesseract

sudo apt install tesseract

参见stackoverflow
http://stackoverflow.com/questions/28741563/pytesseract-no-such-file-or-directory-error

tips

猜你喜欢

转载自www.linuxidc.com/Linux/2017-03/142019.htm
今日推荐