首先,需要安装vs2015或vs2017。
windows上编译pycocotools出现错误:
c1: fatal error C1083: 无法打开源文件: “pycocotools/_mask.c”: No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed
with exit status 2
解决办法:
pip install cython # python3
因为你的python环境里面没有安装cython,需要在python环境中安装cython后便解决该问题。
安装 pycocotools:
pip install cython
git clone https://github.com/cocodataset/cocoapi.git
cd coco/PythonAPI
python setup.py build_ext --inplace # 全局安装
python setup.py build_ext install # python环境内安装