安装psutil时提示缺乏python.h头文件(做记录)

  经过pip或者源码安装psutil,都会提示缺乏python.h头文件,错误提示以下:python

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

  出现此错误的缘由是没有安装python-devel,python开发包,若是是支持yum的系统,直接yum安装便可:spa

yum -y install python-devel
相关文章
相关标签/搜索