상세 컨텐츠

본문 제목

Visual studio를 설치했지만 opencv-python 설치에 오류가 발생시 해결방법

Error

by byoelcardi 2023. 6. 21. 20:44

본문

728x90

opencv-python를 설치할 때 간혹 이런 오류를 만나곤한다. (주로 윈도우 환경에서 발견된다.)

Building windows wheels for Python 3.8 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

 

일반적으로는 Visual Studio를 설치하면 해결되지만 Visual Studio를 설치해도 오류가 수정되는 경우가 있다. 이 경우에는 

pip install --upgrade pip setuptools wheel

을 먼저 파이썬 패키지를 빌드, 설치, 관리하기 위한 도구를 먼저 설치해주면 해결됩니다.

관련글 더보기