[tensorflow] 윈도우에서 pycocotools 설치 에러

[tensorflow] pycocotools 설치 에러

[tensorflow] 윈도우에서 pycocotools 설치 에러

enter image description here

윈도우에서 왜인지 모르겠지만 설치가 계속 안됨

에러 로그는 아래와 같다. (중요 경로 보안 로그는 지움)

$ pip install -q pycocotools
  ERROR: Command errored out with exit status 1:
   command: 
  Complete output (14 lines):
  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
  skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
  building 'pycocotools._mask' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
    ERROR: Command errored out with exit status 1:
     command:
    Complete output (14 lines):
    running install
    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
    skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
    building 'pycocotools._mask' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 
Check the logs for full command output.
  1. 여러 방법들 중 가장 쉬운 방법
pip install pycocotools-windows
  1. 또 다른 방법
    선행 설치
    Microsoft C++ Build Tools : https://visualstudio.microsoft.com/visual-cpp-build-tools/
git clone https://github.com/pdollar/coco.git
cd coco/PythonAPI

편집기로 setup.py 수정
아래의 열을

extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],

이렇게 수정

extra_compile_args=['-std=c99'],

저장 후 install

python setup.py install

끝.

도움이 되셨다면 더 좋은 정보 공유를 위해 광고 클릭 부탁 드립니다 :)

댓글 쓰기

0 댓글