1、安裝Python依賴html
pip install pytesseract pyocr pillow Image
pip安裝:https://www.cnblogs.com/Javame/p/10918325.htmlspa
2、下載並安裝 tesseract-ocr:.net
wget https://download.csdn.net/download/yiyu1/11200375
3、修改pytesseract.pycode
位置:..\lib\site-packages\pytesseract\pytesseract.pyhtm
tesseract.exe來源第二步安裝後Tesseract-OCR/tesseract.exe執行文件快捷方式。blog
4、找張圖片圖片
5、Python代碼ip
from PIL import Image import pytesseract image = Image.open(r'E:\test.png') code = pytesseract.image_to_string(image) print(code)
6、執行腳本get