赞
踩
1.1 python 安装
我安装使用的环境是Win10 + Python3.7.9,python版本可以到python官网进行下载
安装。
1.2 pip 升级
使用这个名称进行升级: python3.7 -m pip install --upgrade pip
2.1 下载依赖文件:
下载地址:https://github.com/PaddlePaddle/PaddleOCR
进入 requirements.txt 文件所在目录。
使用命令安装:pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
我的requirements.txt 文件内容如下:大家可以参考安装
shapely scikit-image imgaug pyclipper lmdb tqdm==4.64.1 numpy==1.19.3 visualdl rapidfuzz opencv-python==3.4.2.16 opencv-contrib-python==3.4.2.16 cython lxml premailer openpyxl attrdict Polygon3 lanms-neo==1.0.2 PyMuPDF==1.19.0
问题:
Building wheel for lanms-neo (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for lanms-neo (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [10 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-37 creating build\lib.win-amd64-cpython-37\lanms copying lanms\__init__.py -> build\lib.win-amd64-cpython-37\lanms running build_ext building 'lanms._C' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for lanms-neo
解决办法:
安装vs2022 可以选择社区版安装
安装地址:https://visualstudio.microsoft.com/zh-hans/vs/
安装完成后 新建一个项目, 然后执行 pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple paddleocr
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple paddlepaddle
运行以下代码 没有报错 则安装成功
from paddleocr import PaddleOCR, draw_ocr
ocr = PaddleOCR(use_angle_cls=True, lang="ch")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。