安裝pycocotools時,首先遇到的是錯誤1,經過一番折騰終於解決。但又出現錯誤2,唉接着解決。。。
在windows下可能會出現以下錯誤:
錯誤1:
解決辦法:
因爲沒有Visual C++ 編譯環境。解決方式:
安裝Build Tools for Visual Studio 2017 (2015版及以後就行,不需要安裝整個vs)
安裝過程我都選擇了默認安裝,安裝成功,問題解決。
錯誤2:
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pycocotools
解決辦法:
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
即可安裝成功。