我下载了PyTesser并提取了它。
我在pytesser_v0.0.1文件夹中,试图在python解释器中运行sample usage代码:
from pytesser import *
print image_file_to_string('fnord.tif')以及产出:
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注:我在Ubuntu 12.10和Python 2.7.3
有人能帮我理解这个错误吗?我能做些什么来纠正它?
发布于 2013-08-19 22:54:06
这不是很好的文档,但如果你不在Windows上,你需要为你的平台安装tesseract二进制文件。在Ubuntu和其他基于Debian的Linux发行版上,apt-get install tesseract-ocr。然后你就可以跑:
python pytesser.py它使用测试文件phototest.tif、fnord.tif和fonts_test.png来测试库。
发布于 2015-12-11 19:00:37
对于windows上的初学者使用pytesseract:
pip install pytesseract (这将轻松地在您的python上安装pytesseract最后一个版本模块)有关更多信息,请参见代码示例,请查看此链接:http://www.manejandodatos.es/2014/11/ocr-python-easy/
https://stackoverflow.com/questions/18322933
复制相似问题