欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

pycharm安裝opencv-python報(bào)錯(cuò)的解決

 更新時(shí)間:2023年07月04日 15:24:02   作者:dsdasun  
本文主要介紹了pycharm安裝opencv-python報(bào)錯(cuò)的解決,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

問題一 通過pycharm中的Terminal窗口安裝opencv-python錯(cuò)誤如下:

上圖所示為部分錯(cuò)誤,全部錯(cuò)誤如下:

  Building wheel for opencv-contrib-python (PEP 517) ... error
  ERROR: Complete output from command 'D:\anzhuanglujing\Anaconda\python.exe' 'D:\anzhuanglujing\Anaconda\lib\site
-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\Administrator\AppData\Local\Temp\tmpjqvqd9_8':
  ERROR: 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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  CMake Error at CMakeLists.txt:2 (PROJECT):
    Generator
  
      Visual Studio 17 2022
  
    could not find any instance of Visual Studio.
  
  
  
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/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/Administrator/AppData/Local/Temp/pip-install-bc_r227f/opencv-contrib-python/_cmake_test_compi
le/build/CMakeFiles/CMakeOutput.log".
  
  
  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 17 2022 x64 v143)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja (Visual Studio 17 2022 x64 v143)" generator - failure
  --------------------------------------------------------------------------------
  
  
  
  --------------------------------------------------------------------------------
  -- Trying "Visual Studio 17 2022 x64 v143" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Visual Studio 17 2022 x64 v143" generator - failure
  --------------------------------------------------------------------------------
  
  
  
  --------------------------------------------------------------------------------
  -- 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 "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 17 2022 x64 v143)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 17 2022 x64 v143)" generator - failure
  --------------------------------------------------------------------------------
  
  
  
  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" 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 2022.
  Get it with "Visual Studio 2017":
  
    https://visualstudio.microsoft.com/vs/
  
  Or with "Visual Studio 2019":
  
    https://visualstudio.microsoft.com/vs/
  
  Or with "Visual Studio 2022":
  
    https://visualstudio.microsoft.com/vs/
  
  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for opencv-contrib-python
  Running setup.py clean for opencv-contrib-python
Failed to build opencv-contrib-python
ERROR: Could not build wheels for opencv-contrib-python which use PEP 517 and cannot be installed directly
 

解決辦法:升級(jí)pip版本,命令如下:python -m pip install --upgrade pip

升級(jí)后顯示如下圖所示:

安裝opencv-python,

命令如下:pip install opencv-contrib-python -ihttps://pypi.tuna.tsinghua.edu.cn/simple

安裝成功后結(jié)果如下圖所示:

問題二用默認(rèn)源安裝庫(kù),一般來說下載的速度很慢,更何況opencv這種比較大的庫(kù),所以我使用的是豆瓣源(當(dāng)然你也可以使用清華源…)

安裝語(yǔ)句

pip install opencv-python -i https://pypi.doubanio.com/simple/

報(bào)錯(cuò)

解決方案一

遇到這個(gè)問題之后,我在網(wǎng)上查閱解決方法,有文章說是需要安裝cmake(但是其實(shí)沒有實(shí)際解決,嚴(yán)格按照文章步驟操作,最后將會(huì)成功安裝opencv)

安裝語(yǔ)句

pip install cmake -i https://pypi.doubanio.com/simple/

以上是cmake安裝成功的信息提示

問題再現(xiàn)當(dāng)安裝完cmake之后,我又重新使用pip安裝opencv,但是依舊沒能安裝成功 ?? 依然還是與問題一同樣的報(bào)錯(cuò)。于是,我又重新查閱網(wǎng)上資料,得到的解決方案是,需要更新pip工具包。

解決方案二

需要修復(fù)pip。

修復(fù)語(yǔ)句

python -m ensurepip

安裝成功后,再重新更新pip工具包

python -m pip install --upgrade pip setuptools wheel

這時(shí)候發(fā)現(xiàn)pip工具包已經(jīng)更新成功。

緊接著,再次嘗試更新opencv。

pip install opencv-python -i https://pypi.doubanio.com/simple/

發(fā)現(xiàn)opencv也已經(jīng)安裝成功!問題解決~ ??

 到此這篇關(guān)于pycharm安裝opencv-python報(bào)錯(cuò)的解決的文章就介紹到這了,更多相關(guān)pycharm安裝opencv-python報(bào)錯(cuò)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論