我在安装tesserocr出现了AttributeError: module ‘pip’ has no attribute 'pep425tags’的问题,在爬虫中用OCR(optical character recognition)光学符号来识别,tesserocr是python的一个OCR识别库但其实是对tesseract的一层python API封装,所以在安装tesserocr之前要先安装tesseract。
tesseract下载地址:https://digi.bib.uni-mannheim.de/tesseract,下载之后安装过程需要打勾的全打勾。
tesserocr下载(.whl文件):1.直接在命令行 pip install tesserocr pillow
2.https://pypi.python.org/pypi/tesserocr 下载与tesseract对应的版本
我这里方法一出现了问题,然后我用的方法2,下载之后,我把它放到了python安装路径中,在命令行将路径换到你的.whl文件所在路径, pip install 文件名.whl
出现tesserocr-2.2.2-cp35-cp35-win_amd64.whl is not a supported wheel on this platform,我查了一下,可能是pip支持格式问题:
在命令行查看pip所支持格式,对于32位的系统:1.进入python交互界面,import pip
print(pip.pep425tags.get_supported())
对于64位:1.进入python交互界面,import pip._internal.pep425tags
print(pip._internal.pep425tags.get_supported())
有<cp35-abi3-win_amd64 @ 2124990196424>,而我下载的是tesserocr-2.2.2-cp35-cp35-win_amd64.whl,不支持,所以,修改为tesserocr-2.2.2-cp35-abi3-win_amd64.whl
在.whl所在路径安装文件即可,如图:
AttributeError: module 'pip' has no attribute 'pep425tags'
最新推荐文章于 2020-08-27 12:22:24 发布