安装easyocr报错:ERROR: Could not build wheels for opencv-python-headless, which is required to install p

报错内容:

Building wheels for collected packages: opencv-python-headless
  Building wheel for opencv-python-headless (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\MyPC\.conda\envs\py362\python.exe' 'C:\Users\MyPC\AppData\Roaming\Python\Python36\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\MyPC\AppData\Local\Temp\tmpv0chmpm_'
       cwd: C:\Users\MyPC\AppData\Local\Temp\pip-install-4h5hmjvi\opencv-python-headless_0376574422d3474ab053aec05823dee8
  Complete output (395 lines):


  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 17 2022 x64 v143' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 17 2022

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 17 2022 x64 v143' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 16 2019 x64 v142' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 16 2019

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 16 2019 x64 v142' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'Visual Studio 15 2017 x64 v141' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 15 2017

    could not find any instance of Visual Studio.



  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Visual Studio 15 2017 x64 v141' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator - failure
  --------------------------------------------------------------------------------

  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building windows wheels for Python 3.6 requires Microsoft Visual Studio 2022.
      https://visualstudio.microsoft.com/vs/
  Or with "Visual Studio 2022":
      https://visualstudio.microsoft.com/vs/
  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for opencv-python-headless
Failed to build opencv-python-headless
ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects

重点关注:

说明是 opencv-python-headless安装出现了问题,直接在线安装依然会报错

pip install opencv-python-headless

去下面的官网,离线下载opencv-python-headless

opencv-python-headless · PyPI

官网下载很慢,我已经上传了资源可以免费下载

https://download.csdn.net/download/qq_55888300/88648789

安装成功opencv-python-headless之后再安装 easyocr 即可

  • 11
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 根据引用的信息,错误信息"ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects"表明在安装基于pyproject.toml的项目时无法构建opencv-python-headless的轮子。这个错误可能是由于缺少相关依赖或者编译环境配置不正确所致。为了解决这个问题,可以尝试以下几个步骤: 1. 确保已安装正确的编译工具和依赖项,例如CMake和Python开发包。 2. 检查操作系统上的环境变量和路径配置,确保编译工具和依赖项的路径正确设置。 3. 更新pip和setuptools到最新版本,然后重新安装opencv-python-headless。 4. 如果仍然无法解决问题,可以尝试使用预编译的二进制包来安装opencv-python-headless,而不是构建轮子。 希望以上信息对您有所帮助!123 #### 引用[.reference_title] - *1* [关于Could not build wheels for opencv-python-headless, which is...报错的解决方案](https://blog.csdn.net/Liu_GuoXing/article/details/129280877)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] - *2* *3* [已解决ERROR: Could not build wheels for opencv-python-headless, which is required to install](https://blog.csdn.net/yuan2019035055/article/details/128908284)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值