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

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

2016-11-17 14:02 661 查看
安装Python的psutil模块:
tar zxvf psutil-2.0.0.tar.gz
cd psutil-2.0.0
python setup.py install
报错:
running install
running bdist_egg
......
psutil/_psutil_linux.c:12:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:23:
psutil/_psutil_linux.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
......
psutil/_psutil_linux.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:50: warning: implicit declaration of function ‘syscall’
psutil/_psutil_linux.c: At top level:
psutil/_psutil_linux.c:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
......
psutil/_psutil_linux.c:384: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:421: error: expected specifier-qualifier-list before ‘PyObject’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:470: error: ‘PyObject’ undeclared (first use in this function)
psutil/_psutil_linux.c:470: error: (Each undeclared identifier is reported only once
psutil/_psutil_linux.c:470: error: for each function it appears in.)
psutil/_psutil_linux.c:470: error: ‘module’ undeclared (first use in this function)
psutil/_psutil_linux.c:470: warning: implicit declaration of function ‘Py_InitModule’
psutil/_psutil_linux.c:470: error: ‘PsutilMethods’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
原因:
gcc包已装,缺少python-devel包

解决:
yum install python-devel -y
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  function expected included
相关文章推荐