NameError: name 'pytesseract' is not defined

那年仲夏 提交于 2021-01-29 02:29:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!