不能使用tesseract,那么如何在virtualenv上安装tesseract?

时间:2016-09-23 15:26:46

标签: python virtualenv tesseract

我通过命令venv创建了一个virtualenv。然后我通过命令brew install tesseract安装了tesseract。但我只能在实际环境中使用它,当我在virtualenv上使用它时,错误没有这样的文件或目录:' tesseract' 被抛出:

BlockquoteTraceback (most recent call last):
  File "/Users/abc/PycharmProjects/spider/demo2.py", line 5, in <module>
    vcode = pytesseract.image_to_string(image)
  File "/Users/abc/env1/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 161, in image_to_string
    config=config)
  File "/Users/abc/env1/lib/python3.5/site-packages/pytesseract/pytesseract.py", line 94, in run_tesseract
    stderr=subprocess.PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.5/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'

0 个答案:

没有答案