您的位置:首页 > 编程语言 > Python开发

关于Python安装模块出现error: command 'gcc' failed with exit status 1错误的解决方法

2017-08-15 14:28 2899 查看
当使用pip install ###时,有时会出现如标题上的问题,我遇到的问题如下:

_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1


这是我在安装matplotlib模块的时候出现的问题,重新安装了gcc等各种我能想到的,不过还是不行。到网上找了一下,说是其实安装一个对应的devel环境就可以了。

举个例子,我这里报错是

#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1


其实只要看include缺什么就行了,我缺的时Python.h,所以就安装以下python的devel环境就好

yum install python-devel


其他同类问题同理,对应下载相应的devel环境。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐