我正在使用Pytesser进行python OCR。我已经安装了PIL和Pytesser,并且运行了以下代码:
from pytesser import *
image = Image.open('C:\\Users\\panzer400\\Desktop\\fnord.tif')
print image_to_string(image)然后这个错误出现了
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
print image_to_string(image)
File "C:\Python27\lib\pytesser\__init__.py", line 30, in image_to_string
util.image_to_scratch(im, scratch_image_name)
File "C:\Python27\lib\pytesser\util.py", line 7, in image_to_scratch
im.save(scratch_image_name, dpi=(200,200))
File "C:\Python27\lib\site-packages\PIL\Image.py", line 1406, in save
self.load()
File "C:\Python27\lib\site-packages\PIL\ImageFile.py", line 164, in load
self.load_prepare()
File "C:\Python27\lib\site-packages\PIL\ImageFile.py", line 231, in load_prepare
self.im = Image.core.new(self.mode, self.size)
File "C:\Python27\lib\site-packages\PIL\Image.py", line 37, in __getattr__
raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed这可能意味着什么?我做错什么了?我使用的是Windows 8 64位和Python 2.7.9
发布于 2015-07-22 05:56:24
我在使用pytesseract时遇到了同样的错误,我想它非常类似;对我有效的是安装Pillow (最近维护的?)PIL的分叉)。您可能需要将任何import Image实例更改为from PIL import Image。
(请注意,Pillow仍作为PIL导入)
https://stackoverflow.com/questions/29002024
复制相似问题