PIP安装OpenCv报错

C:\Users\EDY>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting opencv-python
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c4/e2/27a153e27b98410cf5a871096a8baf98dd642e6685d3ebe7abd9edc8d51a/opencv-python-4.5.5.62.tar.gz (89.9MB)
    100% |████████████████████████████████| 89.9MB 416kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy>=1.14.5; python_version >= "3.7" (from opencv-python)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/22/a3/3a5469ebaca59100e50b4300dd011eed943f2aad7c6a80a07966b985e2c6/numpy-1.21.5-cp37-cp37m-win_amd64.whl (14.0MB)
    100% |████████████████████████████████| 14.0MB 2.5MB/s
Building wheels for collected packages: opencv-python
  Building wheel for opencv-python (PEP 517) ... error
  Complete output from command c:\users\edy\appdata\local\programs\python\python37\python.exe c:\users\edy\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\pep517\_in_process.py build_wheel C:\Users\EDY\AppData\Local\Temp\tmpccu9cj3w:
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 16 2019

    could not find any instance of Visual Studio.

  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Ninja

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      Visual Studio 15 2017

    could not find any instance of Visual Studio.

  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/EDY/AppData/Local/Temp/pip-install-hk4cvgjf/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".


  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 16 2019 x64 v142)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 16 2019 x64 v142)" generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 16 2019 x64 v142" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 16 2019 x64 v142" generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 x64 v141)" generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 15 2017 x64 v141" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 15 2017 x64 v141" generator - failure
  --------------------------------------------------------------------------------

  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 x64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- 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.7 requires Microsoft Visual Studio 2019.
  Get it with "Visual Studio 2017":

    https://visualstudio.microsoft.com/vs/

  Or with "Visual Studio 2019":

    https://visualstudio.microsoft.com/vs/

  ********************************************************************************

  ----------------------------------------
  Failed building wheel for opencv-python
  Running setup.py clean for opencv-python
Failed to build opencv-python
Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly
You are using pip version 19.0.3, however version 21.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值