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.py3d
位置:..\lib\site-packages\pytesseract\pytesseract.pycode
tesseract.exe來源第二步安裝後Tesseract-OCR/tesseract.exe執行文件快捷方式。htm
4、找張圖片blog
5、Python代碼圖片
from PIL import Image import pytesseract image = Image.open(r'E:\test.png') code = pytesseract.image_to_string(image) print(code)
6、執行腳本ip