解决PaddleOCR安装lanms-neo时报错,Could not build wheels for lanms-neo ...

解决PaddleOCR安装lanms-neo时报错

    • 问题
    • 解决方案

问题

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

我没有使用pip install paddleocr

而是去下载Github上的PaddleOCR项目

PaddleOCR V2.6

然后进入项目执行命令时

pip install -r requirements.txt -i https://mirror.baidu.com/pypi/simple

到了安装lanms-neo,报错,并且提示Microsoft Visual C++ 14.0 的环境问题

× 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

单独安装一样报错pip install lanms-neo==1.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

然后找了论坛上的
solved_packageMissInInstalling_mu_visual_cpp_build_tools_2015_update_3_x64_dvd_dfd9a39c.iso
安装,但是没有成功,提示需要更高的版本

      lanms.cpp
      d:\temp\pip-build-env-w005pfjp\overlay\lib\site-packages\pybind11\include\pybind11\detail/common.h(147): fatal error C1189: #error:  pybind11 2.10+ requires MSVC 2017 or newer
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
      [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

解决方案

下载vs_BuildTools.exe

找到社区版,点击安装
解决PaddleOCR安装lanms-neo时报错,Could not build wheels for lanms-neo ..._第1张图片

进入单个组件,找到MSVC v143-VS2022C++x64/X86生成工具(最新)下载安装
解决PaddleOCR安装lanms-neo时报错,Could not build wheels for lanms-neo ..._第2张图片
再测试,安装成功

PS D:\PythonProjects\PaddleOCR-dev> pip install lanms-neo==1.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting lanms-neo==1.0.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/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) ... done
  Created wheel for lanms-neo: filename=lanms_neo-1.0.2-cp310-cp310-win_amd64.whl size=86168 sha256=f371210746178757d10a5e3272c1a7f1d981a0784262f4602ef65ea3654126e3
  Stored in directory: 
Successfully built lanms-neo
Installing collected packages: lanms-neo
Successfully installed lanms-neo-1.0.2

你可能感兴趣的:(环境构建,#,OCR,windows,python)