tesserocr主要用于处理在爬虫中遇到的验证码
1: 我们首先使用Homebrew安装ImageMagick和tesseract库:
brew install imagemagick
brew install tesseract --all-languages
2: 使用用pip安装tesserocr
pip3 install tesserocr pillow
3: 安装tesserocr时遇到:
tesserocr.cpp:668:10: fatal error: 'ios' file not found
同时也会有GCC的问题出现,应当注意GCC红字提示上一行的具体问题是什么,再进行处理。
处理方法:
sudo CFLAGS="-mmacosx-version-min=10.14" pip3 install tesserocr
(10.14是你的Macos版本号,通过左上角苹果图标-关于本机查看)
参考:https://blog.csdn.net/u012203711/article/details/85102954