linux的python identifier,Linux运维知识之安装Python的psutil模块时报错:error: command 'gcc' failed with exit status ...

本文主要向大家介绍了Linux运维知识之安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。

安装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

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值