2017-04-08 198 views
0

我试过很多方法来安装Tesseract,但我似乎无法得到它的工作。我在Mac上,这是我不断收到的错误安装tesseract Mac OS时发生错误

txt = pytesseract.image_to_string(image, lang='eng') 
    File "/Users/user/anaconda/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 161, in image_to_string 
    config=config) 
    File "/Users/user/anaconda/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 94, in run_tesseract 
    stderr=subprocess.PIPE) 
    File "/Users/user/anaconda/lib/python2.7/subprocess.py", line 711, in __init__ 
    errread, errwrite) 
    File "/Users/user/anaconda/lib/python2.7/subprocess.py", line 1343, in _execute_child 
    raise child_exception 
OSError: [Errno 2] No such file or directory 

有没有人知道我可以用tesseract解决这个问题?

+0

什么是“图像”?一个文件路径?这是否存在? –

+0

或'pytesseract'试图运行'tesseract'?你的问题从来没有显示安装tesseract,那么**错误是什么? –

回答

0

Anaconda确实有conda Tesseract包可用。使用下面的命令安装它并重试。

conda install -c brown-data-science tesseract=3.05.00 

如果你需要最新vesrion Tesseract 4.00.00alpha,您可以参考github上的安装说明。如果您没有安装XcodeHomebrew,请选择this进行安装。