Ubuntu16 安装cocoapi中的x86_64-linux-gnu-gcc: error: pycocotools/_mask.c: No such file or directory 问题

在官方的github的issue中大家讨论了这个问题:

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

最全面的方案如下

  1. whether you have installed cython in the correct version. Namely you should install cython for python2/3 if you use python2/3

  2. whether you have downloaded the whole .zip file from this github project. Namely, you should download all the things here even though you only need PythonAPI

  3. whether you open Terminal and run "make" under the correct folder. The correct folder is the one that "Makefile" is located in

  4. whether you have already installed gcc in the correct version

  5. whether you have already installed python-dev in the correct version. Namely you should install python3-dev (you may try "sudo apt-get install python3-dev"), if you use python3.

一般就是

pip install cython

或者使用 python3来安装。但是我在使用的过程中尝试了所有的方法都不行,后来我把cocoapi的权限降到了可读可写,就能编译成功了。

sudo chmod -R 777 cocoapi

最后总结一下,网上的各种方法都可以尝试一遍,一般来说就是包的安装正确与否、权限的设置以及环境的配置。祝大家好运!

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值