經過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