安裝: pip install tesseract (預設有英文文字庫)
下載下傳: https://github.com/tesseract-ocr/tessdata 下載下傳中文 chi_sim.traineddata 放進/usr/share/tesseract-ocr/4.00/tessdata裡
在python中操作的話 再安裝一個庫 pip install pytesseract (pip install PIL ,一般都已經安裝好了,不過如果前面那個識别不了圖檔 抱着個錯,那可以再多安裝這個)
識别的時候出問題報錯 pytesseract.pytesseract.TesseractNotFoundError: xxxxx tesseract is not installed or it's not in your path
在pytesseract.py(該檔案在報錯的資訊裡有,點選即可打開) 裡修改路徑 就像django裡修改setting一樣 将tesseract_cmd 的路徑值改為他所在的那個檔案路徑,具體可以在終端查找一下(指令:which tesseract) 複制下來一改就好了