python安装模块的时候报错error: command 'gcc' failed with exit status 1

Posted Frankiee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python安装模块的时候报错error: command 'gcc' failed with exit status 1相关的知识,希望对你有一定的参考价值。

【情况】

在写Python代码的时候,需要用到psutil模块,需要安装。

但是在安装时,报错:error: command ‘gcc‘ failed with exit status 1

 

 

【解决步骤】

按照经验,觉得应该是缺少了gcc模块, 所以操作 [ yum install -y gcc ]

安装完成后,再继续安装psutil还是报同样的错,发现报错不是  not found gcc,可能是某个功能模块缺失

发现需要安装多一些依赖的包:  [ yum install -y libffi-devel python-devel openssl-devel ]

以上是关于python安装模块的时候报错error: command 'gcc' failed with exit status 1的主要内容,如果未能解决你的问题,请参考以下文章