python 安装psutil

本文详细介绍了在安装Python组件psutil过程中遇到的错误及其解决方案。错误主要源于缺少python-devel包,通过使用yum命令进行安装即可解决。文章还提供了具体的安装步骤。

在使用python组件psutil时需要先安装,具体如下:

 

    wget https://pypi.python.org/packages/source/p/psutil/psutil-2.0.0.tar.gz
    tar -xzvf psutil-2.0.0.tar.gz
    cd psutil-2.0.0
    python setup.py install

安装的过程中可能报错如下:

psutil/_psutil_linux.c:421: error: expected specifier-qualifier-list before ?.yObject?
psutil/_psutil_linux.c: In function ?.nit_psutil_linux?.
psutil/_psutil_linux.c:470: error: ?.yObject?.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: ?.odule?.undeclared (first use in this function)
psutil/_psutil_linux.c:470: warning: implicit declaration of function ?.y_InitModule?
psutil/_psutil_linux.c:470: error: ?.sutilMethods?.undeclared (first use in this function)
error: command 'gcc' failed with exit status 1

报错原因为没有安装python-devel导致,直接yum安装即可。

 

转载于:https://www.cnblogs.com/aity007/p/9443935.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值