[英]Error:ModuleNotFoundError: No module named 'Image'
I am getting the following error: 我收到以下错误:
ModuleNotFoundError: No module named 'Image'
ModuleNotFoundError:没有名为“图像”的模块
while running the below script for OCR: 在运行以下OCR脚本时:
import Image
from tesseract import image_to_string
print(image_to_string(Image.open('marlboro.png'), lang='eng'))
I am using Spider through Anaconda and have Pillow installed. 我正在通过Anaconda使用Spider并安装了Pillow。
You should install pytesseract
use pip (also see guide ): 您应该安装
pytesseract
use pip(另请参见指南 ):
pip install pytesseract
and then: 接着:
from PIL import Image
from pytesseract import image_to_string
print(image_to_string(Image.open('marlboro.png'), lang='eng'))
or use python cross-platform module tesseract
: 或使用python跨平台模块
tesseract
:
pip install tesseract
and use it as you have in your question: 并按照您的问题使用它:
from PIL import Image
from tesseract import image_to_string
print(image_to_string(Image.open('marlboro.png'), lang='eng'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.