现象 报错没有 leptonica/allheaders.h报错 ld: library not found for -ltesseract 解决方案 brew install tesseract CPPFLAGS=-I/opt/homebrew/include LIBRARY_PATH=/opt/homebrew/lib pip3 install tesserocr 解释:安装tesserocr依赖的环境tesseract,并且设置变量将include和lib path暴露给pip3。