gpt4 book ai didi

python - PyTesseract 不工作

转载 作者:太空宇宙 更新时间:2023-11-03 16:23:56 25 4
gpt4 key购买 nike

安装 PyTesseract 后,我​​进入 Mac 终端以确保其正常工作。我把它输出到一个文本文件中,完美地找到了,但在 Enthought Canopy 中运行此代码后:

import pytesseract
from PIL import Image

print pytesseract.image_to_string(Image.open('/Users/Nelson/Desktop/Projects/R6S Statistics/OCR/ocr-test.png'))

我明白了:

AttributeError: 'ImagingDecoder' object has no attribute 'pulls_fd'

此错误来自 PIL 文件:

/Users/Nelson/Desktop/Canopy/User/lib/python2.7/site-packages/PIL/ImageFile.pyc

最佳答案

我能够通过重新启动我的 Jupyter 笔记本内核来解决此错误。我在笔记本 session 中执行了 pip install --upgrade scikit-image 并收到了此错误。升级安装了较新版本的 PIL (v4.0),但之前安装的 (v3.2) 版本已加载到内存中。

关于python - PyTesseract 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38167486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com