问题
Pytesseract is not recognized. I have tried all fixes documented online, including adding Tesseract-OCR to my Path variables, incorporating the pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
command path in my script, uninstalling and reinstalling pytesseract and tesseract.
回答1:
In the line 23
vpnbookpassword = pytesseract.image_to_string(pwdi)
there you have mentioned pytesseract.image_to_string
but you have imported image_to_string
from pytesseract import image_to_string
and not pytesseract so it could not find pytesseract.
So writing it as vpnbookpassword = image_to_string(pwdi)
would solve the issue
来源:https://stackoverflow.com/questions/60556661/nameerror-name-pytesseract-is-not-defined