If pytesseract is not installed in your virtual environment or your directories install it in your virtual environment or in your directorie by using the link:
or by running the command on your command prompt:
pip install pytesseract
Make sure that the tesseract path from default installation time is:
, or it may change. So carefully check the installation path and note it.
Set the tesseract path in the script before calling image_to_string by running commang:
pytesseract.pytesseract.tesseract_cmd = r‘C:/Users/USER/AppData/Local/Tesseract-OCR/tesseract.exe’
I hope this may help you.