윈도우 pycocotools에서 설치

Windows에서 설치 pycocotools 패키지, 피트 많은, 우리가 덜 수 있도록 약간의 우회로를 가고 싶어이 글을 만났을 때. pycocotools 저자는 심지어 윈도우 버전을 고려하지 않았다.

  • 설치 pycocotools

코코 주소 : https://github.com/cocodataset/cocoapi
갱스터 윈도우 코코 주소에 대한 재 작성 지원 : https://github.com/philferriere/cocoapi

옵션 하나

CMD 단자를 사용하여 설치 PIP :

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

옵션 II

https://github.com/philferriere/cocoapi 소스 코드를 다운로드하여 압축을 풉니 다. CMD는 관리자 권한으로 터미널을 열고으로 전환 cocoapi\PythonAPI디렉토리. 다음 명령을 실행합니다 :

# install pycocotools locally
python setup.py build_ext --inplace
 
# install pycocotools to the Python site-packages
python setup.py build_ext install

  • 첨부 : 설치 문제가 발생

1, 설치 환경 문제

error: command 'cl.exe' failed: No such file or directory
// 或者
error: Unable to find vcvarsall.bat
// 或者
error: Microsoft Visual C++ 14.0 is required.
13068476-fd34bcc230e46425.png
오류 : 명령 'CL.EXE은'실패 : 없음 같은 파일 또는 디렉터리를
13068476-b9a1c847c72016de.png
자식을 설치 PIP + HTTPS : //github.com/philferriere/cocoapi.git#subdir

더 비주얼 C ++ 컴파일러 환경이 없기 때문입니다. 해결 방법 :
(대 전체를 설치할 필요가 없습니다, 나중에 라인에 2015 버전) 비주얼 스튜디오 2017에 대한 빌드 도구를 설치


13068476-7b7cca0a76646238.png
vs2015

2 Wno-CPP와 Wno 미사용 기능 문제

CL : 명령 줄 오류 D8021 : 잘못된 수치 매개 변수 "/ Wno-CPP"와 CL : 명령 줄 오류 D8021 : 잘못된 수치 매개 변수 "/ Wno 사용되지 않는 기능

해결 방법 : 삭제 cocoapi\PythonAPI\setup.pyWno-CPP와 Wno 사용되지 않는 기능 매개 변수를 설정합니다.

13068476-6618ef3135277c23.png
Wno-CPP 매개 변수를 삭제

추천

출처blog.csdn.net/weixin_34138521/article/details/90818353