Problem with python script that takes image to text

59 Views Asked by At

When running this script and trying to paste it, it doesn't work.

import pytesseract
import pyperclip
import PIL.Image

# Open the image file
image = PIL.Image.open('generate_word_picture.png')

# Extract the text from the image using pytesseract
text = pytesseract.image_to_string(image)

# Copy the text to the clipboard
pyperclip.copy(text)

This is the image: Image

I have these installed:

-pip install pytesseract

-pip install pyperclip

-https://github.com/UB-Mannheim/tesseract/wiki

0

There are 0 best solutions below