栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

pycocotools安装踩坑记录

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

pycocotools安装踩坑记录

pycocotools安装踩坑记录
  • pycocotools安装踩坑记录

pycocotools安装踩坑记录

在ubuntu上安装pycocotools的时候老是安装不成功,最后不断的尝试终于成功了,下面记录这个过程。issue的网址如下:

https://github.com/cocodataset/cocoapi/issues/172

首先是官方的安装方法:

git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
make

报错:

/anaconda/envs/py38_default/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /anaconda/envs/py38_default/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /anaconda/envs/py38_default/include -fPIC -I/anaconda/envs/slowfast/lib/python3.8/site-packages/numpy/core/include -I../common -I/anaconda/envs/slowfast/include/python3.8 -c ../common/maskApi.c -o build/temp.linux-x86_64-3.8/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
unable to execute '/anaconda/envs/py38_default/bin/x86_64-conda-linux-gnu-cc': No such file or directory
error: command '/anaconda/envs/py38_default/bin/x86_64-conda-linux-gnu-cc' failed with exit status 1
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1

按照issue里面的解决方案,首先安装Cython:

sudo pip install cython

如果用的是anaconda,可能需要:

conda install cython

安装之后仍然报错。issue上还说改makefile文件,把里面的python全部改为python3,但是还是不行,而且issue里面有人说只对于windows用户有用。最后尝试了一下:

sudo make

安装成功!如果遇到同样问题的可以按照这个流程试一下。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/467894.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号