当前位置: 移动技术网 > IT编程>脚本编程>Python > 安装psutil时提示缺少python.h头文件(作记录)

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

2018年10月16日  | 移动技术网IT编程  | 我要评论

3U8852,袁卓坚,骑虎成人网

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

...
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安装即可:

yum -y install python-devel

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网