使用 pytesseract庫安裝完成后,它并不能識別出圖片內(nèi)容,會報(bào)錯(cuò)pytesseract.pytesseract.TesseractNotFoundError
問題描述
增加了環(huán)境變量,依舊識別失敗,以下是異常代碼
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in your PATH. See README file for more information.
原因分析:
tesseract_cmd = ‘tesseract’
pytesseract中的tesseract_cmd引用錯(cuò)誤,修改這個(gè)就好
解決方案:
tesseract_cmd = r’E:\code\python\heSuan\Tesseract\tesseract.exe’
找到pytesseract文件,修改為軟件安裝的實(shí)際地址,注意一定要找到tesseract.exe這個(gè)文件的安裝路徑,
一定要注意路徑前加r
其他問題
pytesseract 文件找不到,用pycahrm尋找文章來源:http://www.zghlxwxcb.cn/news/detail-463473.html
- 打開空文件導(dǎo)入包,按Ctrl + 鼠標(biāo)左鍵點(diǎn)擊pytesseract
- 繼續(xù)按Ctrl + 鼠標(biāo)左鍵點(diǎn)擊pytesseract
- 在新文件中找到tesseract_cmd ,修改地址,注意路徑前的r
小結(jié)
記錄Bug,讓他人少走彎路文章來源地址http://www.zghlxwxcb.cn/news/detail-463473.html
到了這里,關(guān)于tesseract使用時(shí)遇到的問題:tesseract is not installed or it‘s not in your PATH的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!