pip install pycocotools报错

这篇博客介绍了在安装pycocotools过程中遇到的问题及其解决方案,包括使用pip命令直接安装和源码编译安装两种方法,并提到了可能出现的git和gcc错误的处理办法,如更换git镜像源和安装必要的Python及GCC依赖库。
摘要由CSDN通过智能技术生成

相关报错如下所示:
解决方法:
1.直接命令法
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
2.源码安装
git clone https://github.com/pdollar/coco.git
cd coco/PythonAPI
python setup.py build_ext --inplace # install pycocotools locally
python setup.py build_ext install # install pycocotools to the Python site-packages
若git github有问题,执行git config --global url.“https://github.com.cnpmjs.org/”.insteadOf “https://github.com/”
若python setup.py build_ext --inplace报错error: command ‘gcc’ failed with exit status 1,执行以下命令安装相关依赖:
yum install python-devel
yum install python3-devel
yum install gcc libffi-devel python-devel openssl-devel -y

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值