Bootstrap

【已解决】paddleocr:ERROR: Could not build wheels for lanms-neo, which is required to install pyproject

说明

最近在尝试使用paddlenlp和paddleocr,安装paddlenlp很顺利,但是安装paddleocr时遇到了一些问题,记录一下
首先说一下我个人的主要环境配置:
系统:win10
python环境:3.7
paddlenlp 2.4.2
paddlepaddle 2.3.2
pip 22.3
有一些类似于Shapely 的包,需要下载手动安装,报错缺少安装即可,教程很多,这里不再解释,记录一下没搜到的问题,最后时在github上求助得到解决的。

问题

pip安装paddleocr报错
有一些其他问题,但是较好解决
下面这个错误没有找到相关方案

Failed to build lanms-neo
ERROR: Could not build wheels for lanms-neo, which is required to install pyproject.toml-based projects

第一次尝试

于是我上GitHub进行了提问,回复很快(应该是官方人员),现在把过程记录下来
首先是让我尝试直接安装lanms-neo

pip install lanms-neo -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

跟之前直装paddleocr是一样的问题,依旧报错

(venv) D:\Program Files\paddle_NLP>pip install lanms-neo -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple
Collecting lanms-neo
Downloading http://pypi.doubanio.com/packages/7b/fe/beff7e7e4455cb9f69c5734897ca8552a57f6423b062ec86b2ebc1d79c0d/lanms_neo-1.0.2.tar.gz (39 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: lanms-neo
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
Failed to build lanms-neo
ERROR: Could not build wheels for lanms-neo, which is required to install pyproject.toml-based projects

检查了Microsoft Visual C++ 的版本,也是14+,跟这个其实没关系

在这里插入图片描述

第二次尝试

更换版本
应该是官方维护人员,建议安装2.6.0.3或2.6.0.2试试

最后使用2.6.0.2安装成功,但是2.6.0.3还存在相同问题
不过也可以使用了

;