from PIL import Image
from pytesser import *
image_file = 'D:\plate.jpg'
im = Image.open(image_file)
text = image_to_string(im)
text = image_file_to_string(image_file)
text = image_file_to_string(image_file, graceful_errors=True)
print "=====output=======\n"
print text
它让我错误
C:\Users\KEN\Anaconda2\python.exe C:/Users/KENIL/PycharmProjects/plate/ocr.py
Traceback (most recent call last):
File "C:/Users/KEN/PycharmProjects/plate/ocr.py", line 2, in <module>
from pytesser import *
File "C:\Users\KEN\PycharmProjects\plate\pytesser.py", line 6, in <module>
import Image
ImportError: No module named Image
即使我已正确安装ananconda以及枕头screenshot of package installed
答案 0 :(得分:0)
您发布的代码没有错误。从错误消息看,错误似乎在模块pytesser.py
中,您可能在不导入它的情况下使用Image
(第6行:-))。