首页 > 代码库 > 安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1
安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1
安装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
本文出自 “神秘园” 博客,请务必保留此出处http://3094526.blog.51cto.com/3084526/1873865
安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。