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

本文详细介绍了如何解决在安装COCO API过程中遇到的cl命令行错误D8021,并提供了两种有效的解决方案。通过使用pip或手动克隆philferriere的cocoapi仓库,可以成功安装pycocotools 2.0版本,为计算机视觉项目提供关键的数据集处理能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值