본문 바로가기
코딩 라이프/에러log

window | 윈도우 pycocotools 설치 에러

by min0114 2023. 1. 11.

윈도우 OS에서  터미널에서 pip install pycocotools 입력하여 

pycocotools설치 에러났을 경우, 

혹은 pip install git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI 했을 경우, 

아래와 같은 오류 메세지가 뜬다 

----------------------------------------------------------------------------------------

Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\pycocotools
      copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
      copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
      copying pycocotools\mask.py -> build\lib.win-amd64-3.8\pycocotools
      copying pycocotools\__init__.py -> build\lib.win-amd64-3.8\pycocotools
      running build_ext
      cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
      d:\mk_workspace\efficient\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\Administrator\AppData\Local\Temp\pip-req-build-hyrx_oel\PythonAPI\pycocotools\_mask.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      building 'pycocotools._mask' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\common
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\Release\pycocotools
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\mk_workspace\efficient\lib\site-packages\numpy\core\include -I../common -Id:\mk_workspace\efficient\include -IC:\Users\Administrator\AppData\Local\Programs\Python\Python38\include -IC:\Users\Administrator\AppData\Local\Programs\Python\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.8\Release\../common/maskApi.obj -Wno-cpp -Wno-unused-function -std=c99
      cl : 명령줄 error D8021 : '/Wno-cpp' 숫자 인수가 잘못되었습니다.
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycocotools
  Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
  Running setup.py install for pycocotools ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pycocotools did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      running install
      running build
      running build_py
      running build_ext
      skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
      building 'pycocotools._mask' extension
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\mk_workspace\efficient\lib\site-packages\numpy\core\include -I../common -Id:\mk_workspace\efficient\include -IC:\Users\Administrator\AppData\Local\Programs\Python\Python38\include -IC:\Users\Administrator\AppData\Local\Programs\Python\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.8\Release\../common/maskApi.obj -Wno-cpp -Wno-unused-function -std=c99
      cl : 명령줄 error D8021 : '/Wno-cpp' 숫자 인수가 잘못되었습니다.
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycocotools

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

 

----------------------------------------------------------------------------------------

 

 

<해결방법>

 

아래와 같이 입력해준다. 

pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"

 

 

 

해결완료 

 

반응형

댓글