我想在Python中实现OCR。当我运行下面的代码:pytesser给出导入错误
from PIL import Image
from pytesser import *
image_file = 'menu.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
我收到以下错误:
Traceback (most recent call last):
File "C:/Python27/ocr.py", line 2, in <module>
from pytesser import *
File "C:/Python27\pytesser.py", line 6, in <module>
ImportError: No module named Image
我在C:\Python27\Lib\site-packages
目录中有一个文件夹的名称pytesser
并在其中来自同一个目录中名为PIL
PILLOW的安装。编号:Why can't Python import Image from PIL?我试过解决方案。但它似乎并没有帮助
的可能的复制[为什么可以从PIL不能Python的导入图像?](http://stackoverflow.com/questions/ 26505958/why-cant-python-import-image-from-pil) – Karin
谢谢。我尝试了那里提到的方法。但它没有帮助。我猜pytesser与PIL整合有问题。但不知道。 –