본문 바로가기
Python

opencv-python 설치 시 오류 (Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly)

by bryan.oh 2022. 3. 22.
반응형
  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

 

new environment 에 설치하는데 저런 오류가 발생합니다.

 

구글링 해보니, 대부분 해결책이

pip install --upgrade pip setuptools wheel

이렇게 하고, 다시 아래처럼 install 하면 해결된다고 하는데요..

pip install opencv-python

 

전 첫번째 명령어도 실행하는데 오류가 발생합니다.

오류 내용은

  File "c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages\pip-19.0.3-py3.7.egg\pip\_vendor\distlib\scripts.py", line 405, in make
    self._make_script(entry, filenames, options=options)
  File "c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages\pip-19.0.3-py3.7.egg\pip\_vendor\distlib\scripts.py", line 309, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages\pip-19.0.3-py3.7.egg\pip\_vendor\distlib\scripts.py", line 245, in _write_script
    launcher = self._get_launcher('t')
  File "c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages\pip-19.0.3-py3.7.egg\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

 

그래서 구글링 해보다가 찾은 해결책은

easy_install -U pip

이렇게 명령어를 날리니 아래와 같은 로그가 찍히면서 금방 끝나네요.

Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/4d/16/0a14ca596f30316efd412a60bdfac02a7259bf8673d4d917dc60b9a21812/pip-22.0.4-py3-none-any.whl#sha256=c6aca0f2f081363f689f041d90dab2a07a9a07fb840284db221
8117a52da800b
Best match: pip 22.0.4
Processing pip-22.0.4-py3-none-any.whl
Installing pip-22.0.4-py3-none-any.whl to c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages
Adding pip 22.0.4 to easy-install.pth file
Installing pip-script.py script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts
Installing pip.exe script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts
Installing pip3-script.py script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts
Installing pip3.exe script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts
Installing pip3.9-script.py script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts
Installing pip3.9.exe script to C:\Users\combr\PycharmProjects\MyTest\venv\Scripts

Installed c:\users\combr\pycharmprojects\mytest\venv\lib\site-packages\pip-22.0.4-py3.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

그리고 다시 opencv 설치

pip install opencv-python

설치가 되었습니다.

 

728x90
반응형

댓글