系统win10+python3.5
从github上下载源码:https://github.com/cocodataset/cocoapi
可以解压到任意文件夹
然后cd到源码目录PythonAPI
安装前需要把PythonAPI下的setup.py里的参数'-Wno-cpp','-Wno-unused-function'删除并保存
ext_modules = [
Extension(
'pycocotools._mask',
sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../common'],
extra_compile_args=['-std=c99'],
)
]
然后输入python setup.py install
安装完成后:
进入lib/site-packages/下可以看到pycocotools-2.0-py3.5-win-amd64.egg文件夹下有个pycocotools文件夹,说明安装成功
安装过程中可能出现的错误:
解决办法:pip install cython