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


安装Python的psutil模块:

tarzxvfpsutil-2.0.0.tar.gzcdpsutil-2.0.0pythonsetup.pyinstall

报错:

runninginstallrunningbdist_egg......psutil/_psutil_linux.c:12:20:error:Python.h:NosuchfileordirectoryInfileincludedfrompsutil/_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‘*’tokenpsutil/_psutil_linux.c:Infunction‘ioprio_get’:psutil/_psutil_linux.c:50:warning:implicitdeclarationoffunction‘syscall’psutil/_psutil_linux.c:Attoplevel: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:expectedspecifier-qualifier-listbefore‘PyObject’psutil/_psutil_linux.c:Infunction‘init_psutil_linux’:psutil/_psutil_linux.c:470:error:‘PyObject’undeclared(firstuseinthisfunction)psutil/_psutil_linux.c:470:error:(Eachundeclaredidentifierisreportedonlyoncepsutil/_psutil_linux.c:470:error:foreachfunctionitappearsin.)psutil/_psutil_linux.c:470:error:‘module’undeclared(firstuseinthisfunction)psutil/_psutil_linux.c:470:warning:implicitdeclarationoffunction‘Py_InitModule’psutil/_psutil_linux.c:470:error:‘PsutilMethods’undeclared(firstuseinthisfunction)error:command‘gcc‘failedwithexitstatus1

原因:

gcc包已装,缺少python-devel包


解决:

yuminstallpython-devel-y


本文出自 “神秘园” 博客,请务必保留此出处http://3094526.blog.51cto.com/3084526/1873865

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

评论关闭