我已通过本教程“ https://circuitdigest.com/microcontroller-projects/optical-character-recognition-ocr-using-tesseract-on-raspberry-pi”正确安装了它。当我在命令行tesseract image.png stdout
中书写时,它可以工作。但是在运行以下脚本时:
import pytesseract
from PIL import Image
image=Image.open('image.png')
text=pytesseract.image_to_string(img, config='')
print(text)
它回答:
Error on line 1
ImportError: No module named tesseract