window10环境下安装pycocotools报错及解决办法

安装pycocotools时,首先遇到的是错误1,经过一番折腾终于解决。但又出现错误2,唉接着解决。。。

在windows下可能会出现以下错误:

错误1:

window10环境下安装pycocotools报错及解决办法

解决办法:

因为没有Visual C++ 编译环境。解决方式:
安装Build Tools for Visual Studio 2017 (2015版及以后就行,不需要安装整个vs)

window10环境下安装pycocotools报错及解决办法

安装过程我都选择了默认安装,安装成功,问题解决。

错误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

即可安装成功。