pip,PyCharm安装tesserocr报错解决办法
在爬取时可能会遇到验证码验证,可以使用tesserocr库识别验证码。但是在安装tesserocr时出现了各种报错。如pip安装pip install tesserocr 或者是 pip install tesserocr都会出现报错,报错内容很多,有python setup.py egg_info did not run successfully.note: This error origina
在爬取时可能会遇到验证码验证,可以使用tesserocr库识别验证码。但是在安装tesserocr时出现了各种报错。如pip安装
pip install tesserocr 或者是 pip install tesserocr
都会出现报错,报错内容很多,有python setup.py egg_info did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed等很多报错提示。
即使是根据其他博主的文章安装了tesseract,和对应的whl文件,也照样报错。使用pycharm直接搜索安装tesserocr安装包也报错了,点开安装失败的详细信息和pip安装失败的报错差不多。
我也查找了大量文章寻找解决问题后面在pycharm再次尝试安装tesserocr时发现了pytesseract安装包,查询后发现pytesseract也可以识别验证码,是chrome提供的一个安装包。我尝试使用pytsseract
import pytesseract
from PIL import Image
image = Image.open('D:\image.png.png')
print(pytesseract.image_to_string(image))
识别的图片
结果如下
可看到识别成功,如果感觉安装tesserocr让自己血压上升不如直接
pip install pytesseract 或者用pycharm直接搜索pytesseract安装,两秒搞定。
pycharm安装pytesseract------>文件------->设置
想要了解更多有关pytesseract

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。
更多推荐
所有评论(0)