我在pytesser_v0.0.1文件夹中并尝试在python解释器中运行示例用法代码:
from pytesser import *
print image_file_to_string('fnord.tif')
Run Code Online (Sandbox Code Playgroud)
和输出:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pytesser.py", line 44, in image_file_to_string
call_tesseract(filename, scratch_text_name_root)
File "pytesser.py", line 21, in call_tesseract
proc = subprocess.Popen(args)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)
注:我在Ubuntu 12.10用Python 2.7.3
任何人都可以帮助我理解这个错误,我该怎么做才能解决它?
Pau*_*ida 12
这并没有尽可能详细记录,但如果您不在Windows上,则需要tesseract为您的平台安装二进制文件.在Ubuntu和其他基于Debian的Linux发行版上,apt-get install tesseract-ocr.然后你可以运行:
python pytesser.py
Run Code Online (Sandbox Code Playgroud)
它使用测试文件phototest.tif,fnord.tif并fonts_test.png测试库.