centos7.2 系统安装psutil报错:error: command ‘gcc‘ failed with exit status 1 解决方法

绝地灬酷狼 2023-01-01 03:48 348阅读 0赞

文章目录

    • 今天安装发现报错psutil:
    • 解决方案:

今天安装发现报错psutil:

  1. psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
  2. #include <Python.h>
  3. ^
  4. compilation terminated.
  5. error: command 'gcc' failed with exit status 1

在这里插入图片描述

解决方案:

可以尝试安装:

  1. # python2
  2. yum install python-devel
  3. # python3
  4. yum install python3-devel

我是python3 使用下面的,安装之后就解决了。

然后安装就成功了:

  1. pip3 install psutil

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,348人围观)

还没有评论,来说两句吧...

相关阅读