centos8 安装 pycocotools 以及遇到的问题

2022/2/11 7:12:40

本文主要是介绍centos8 安装 pycocotools 以及遇到的问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

centos8 安装 pycocotools 以及遇到的问题

  • 系统和工具
  • 注意事项

记录一下安装 pycocotools 遇到的坑,整理一下注意事项。

系统和工具

系统:华为云 centos8
工具:FinalShell 3.9

注意事项

  1. 官网资源下载超级慢,保守估计得下一天,这里推荐使用**清华源**:

    体验飞一般的速度,不像笔者,先使用迅雷下载,然后传到服务器再安装,费劲。。。!

    pip install pycocotools   -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  2. pycocotools 依赖 python3-devel 或者 python36-devel

    不安装这个依赖,会报错 Python.h: No such file or directory

    两者实际是一样的,安装的时候都是安装的 python36-devel

    注意!注意!注意!:很多博客提供的下载命令都是过期的,仅适用于centos7及以前版本

    经过各种试错,才找到正确命令 :

    dnf install python3-devel 或者 dnf install python36-devel
    

    或者:

    yum install python3-devel 或者 yum install python36-devel
    

    在这里插入图片描述

    错误资源命令:

    sudo apt-get install python3.7-dev 或者 yum install python3.7-dev
    
    sudo apt-get install python3-dev 或者 yum install python3-dev
    

    在这里插入图片描述
    在这里插入图片描述

    附上cento8 资源网址: CentOS Repositories
    在这里插入图片描述
    和清华源网址: 清华大学开源软件镜像站

    在这里插入图片描述

  3. 遇到错误

    pycocotools/_mask.c:4:20: fatal error: Python.h: No such file or directory

    笔者遇到这个问题是因为没有安装 python3-devel 按照上安装即可。

参考博客:

安装pycocotools时问题的解决方案
pycocotools/_mask.c:4:20: fatal error: Python.h: No such file or directory



这篇关于centos8 安装 pycocotools 以及遇到的问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程