首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python2.7.9中的Pytesser -打印图像(Image_to_string)错误

Python2.7.9中的Pytesser -打印图像(Image_to_string)错误
EN

Stack Overflow用户
提问于 2015-03-12 12:44:42
回答 1查看 832关注 0票数 0

我正在使用Pytesser进行python OCR。我已经安装了PIL和Pytesser,并且运行了以下代码:

代码语言:javascript
复制
from pytesser import *
image = Image.open('C:\\Users\\panzer400\\Desktop\\fnord.tif')
print image_to_string(image)

然后这个错误出现了

代码语言:javascript
复制
    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

EN

回答 1

Stack Overflow用户

发布于 2015-07-22 05:56:24

我在使用pytesseract时遇到了同样的错误,我想它非常类似;对我有效的是安装Pillow (最近维护的?)PIL的分叉)。您可能需要将任何import Image实例更改为from PIL import Image

(请注意,Pillow仍作为PIL导入)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29002024

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档