使用brew 安裝, 安裝命令以下python
brew install tesseract
安裝python 語言支持git
sudo pip install pytesseract
語言包下載地址:https://github.com/tesseract-ocr/tessdatagithub
選擇中文語言windows
測試代碼測試
from PIL import Image import pytesseract import os os.chdir('D:\\Program Files (x86)\Tesseract-OCR') # 當windows 時使用 text = pytesseract.image_to_string(Image.open('e:\\temp_screen.png'), lang='chi_sim') print text