git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install

cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”

解决办法

https://github.com/philferriere/cocoapi

方法一

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

方法二

git clone https://github.com/philferriere/cocoapi
cd cocoapi/PythonAPI
python setup.py build_ext install
删掉编译时生成的临时目录,其实删不删无所谓,空闲空间足够大时无所谓这点点
rm -rf build

查询一下是否安装成功

(masktextspotter) D:\Projects\cocoapi\PythonAPI>pip list | findstr pycocotools
pycocotools                        2.0

参考

https://blog.csdn.net/benzhujie1245com/article/details/82686973
https://blog.csdn.net/XCCCCZ/article/details/82725409

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐