相关报错如下所示:
解决方法:
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
pip install pycocotools报错
最新推荐文章于 2024-04-26 17:01:41 发布
这篇博客介绍了在安装pycocotools过程中遇到的问题及其解决方案,包括使用pip命令直接安装和源码编译安装两种方法,并提到了可能出现的git和gcc错误的处理办法,如更换git镜像源和安装必要的Python及GCC依赖库。
摘要由CSDN通过智能技术生成