当我尝试在图像上执行ocr以使用Pytesseract获取字符串时:
import pytesseract
import Image
im = Image.open(str('C:\\1host.jpg'))
im.load()
print pytesseract.image_to_string(im)
发生以下错误:
D:\Python27\python.exe C:/Users/user/PycharmProjects/untitled/Pytessercast.py
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/untitled/Pytessercast.py", line 7, in <module>
print pytesseract.image_to_string(im)
File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 161, in image_to_string
File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 94, in run_tesseract
File "D:\Python27\lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "D:\Python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2]