0

我试过了这个例子来提取扫描文档的文本,https://github.com/madmaze/pytesseract如何使用python

import Image 
import pytesseract 

print pytesseract.image_to_string(Image.open('image1.png')) 

四处错误: 文件 “/usr/lib/python2.7/subprocess.py”,线1327,在_execute_child提高child_exception OSError:[Errno 2]没有这样的文件或目录

是否有任何其他方式从扫描文档中提取文本?

+1

这有什么错呀? – timgeb

+0

文件 “/usr/lib/python2.7/subprocess.py”,线1327,在_execute_child 提高child_exception OSERROR:[错误2]没有这样的文件或目录 – vikrant

+0

得到这个错误 – vikrant

回答

0

我发现这个问题,

更新:

/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py 

tesseract_cmd = 'tesseract' =====>> tesseract_cmd = '/usr/local/bin/tesseract' 

而现在它的工作。

+0

这很奇怪,'/ usr/local/bin'默认应该在你的搜索路径中。 – sashoalm

+0

我尝试过,但精度较低,任何其他包可用于相同的功能。 – vikrant

-2

使用以下命令

命令和apt-get安装的Tesseract-OCR

+1

从回溯和以下的讨论中,你可以看到问题与'PIL' /'pillow'完全没有关系。 – iled