pycocotools安装失败解决办法

在windows下配置mmdection2.6时,配置完成试着运行,结果报了以下错:
AttributeError: COCO object has no attribute get_cat_ids
百度一搜,是因为pycocotools安装的不对,需要卸载安装,

卸载时又遇到了
ERROR: Cannot uninstall ‘pycocotools’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
这个问题需要先pip install --ignore-installed pycocotools
之后再pip uninstall pycocotools

重新安装的方法试了好几种,总结如下:
1、pip install pycocotools,我安装时候报错,conda install pycocotools安装也报错
2、pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
安装失败,说找不到对应版本
3、git clone https://github.com/pdollar/coco.git下载源码放到无中文的路经下,进入文件夹cocoapi/PythonAPI下
cmd到文件夹中,运行命令:python setup.py build_ext install
我也安装失败了
4、最后一种是从一个博主那学来的原文链接
pip install git+https://gitee.com/ztdztd/cocoapi.git#subdirectory=pycocotools
运行成功,感谢大佬在这里插入图片描述
20210509更新,切记安装pycocotools前先安装VS,安装时记得选择“使用C++桌面开发,不然还会出错。
20210724更新,如果上述方案都不行,这里附上我的VS配置文件,安装VS的时候点击更多,导入配置,成功后再按照上面的命令行进行安装pycocotools。
链接:https://pan.baidu.com/s/1sfeQwI4y2S31fluJQy3SKw
提取码:rqxz在这里插入图片描述

  • 11
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值