pytesseract,WindowsError: [Error 2] The system cannot find the file specified

pytesseract,WindowsError: [Error 2] The system cannot find the file specified

我是文本新手 extraction.when 我尝试使用 pytesseract as

从 png 图像中提取文本
from PIL import Image
import pytesseract
s=Image.open('d:\test.png')
print(pytesseract.image_to_string(s))

我收到错误信息 这是图像的问题吗(test.png)。test.png是一个数字的图像plate.Should我需要安装其他东西。

根据 PyPi information,您缺少一个额外条件:

Install google tesseract-ocr from http://code.google.com/p/tesseract-ocr/ . You must be able to invoke the tesseract command as "tesseract". If this isn't the case, for example because tesseract isn't in your PATH, you will have to change the "tesseract_cmd" variable at the top of 'tesseract.py'.

然后 link 将我重定向到 https://github.com/tesseract-ocr/tesseract

坦率地说,我很失望这个包没有给你更多信息,说明你错过了这个,无论如何,一旦你安装了底层 tesseract 命令 pytesseract 应该可以正常工作:)