1.首先安裝pytesseract
pip install pytesseract
2.安裝 tesseract-oct
鏈接:https://pan.baidu.com/s/1chjCJnWNlmBgp32YkpcSmw
提取碼:wfb4
按照默認值安裝,安裝完成後將安裝目錄添加環境變量
3.安裝完成後測試
cmd 打開命令窗口輸入命令檢測安裝是否成功
4.識別圖片中內容
import pytesseract
from PIL import Image
pic_name = Image.open('./pic.png')
result = pytesseract.image_to_string(ac,)
print(result)