安装psutil模块报错&安装python-devel
2016-03-25 11:17
549 查看
psutil/_psutil_linux.c:9:20: 错误:Python.h:没有那个文件或目录
In file included from psutil/_psutil_linux.c:19:
psutil/_psutil_linux.h:11: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:12: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:13: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:14: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:15: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:16: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:17: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: 在函数‘ioprio_get’中:
psutil/_psutil_linux.c:32: 警告:隐式声明函数‘syscall’
psutil/_psutil_linux.c: 在文件层:
psutil/_psutil_linux.c:52: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:75: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:100: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:150: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:172: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:192: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:213: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:261: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:285: 错误:expected specifier-qualifier-list before ‘PyObject’
psutil/_psutil_linux.c: 在函数‘init_psutil_linux’中:
psutil/_psutil_linux.c:335: 错误:‘PyObject’未声明(在此函数内第一次使用)
psutil/_psutil_linux.c:335: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
psutil/_psutil_linux.c:335: 错误:所在的函数内也只报告一次。)
psutil/_psutil_linux.c:335: 错误:‘module’未声明(在此函数内第一次使用)
psutil/_psutil_linux.c:335: 警告:隐式声明函数‘Py_InitModule’
psutil/_psutil_linux.c:335: 错误:‘PsutilMethods’未声明(在此函数内第一次使用)
error: command 'gcc' failed with exit status 1
===============================================================
解决方法是安装python-devel,这是Python的头文件和静态库包:
1.可以先查看一下含python-devel的包
yum search python | grep python-devel
2.64位安装python-devel.x86_64,32位安装python-devel.i686,我这里安装:
sudo yum install python-devel.x86_64
In file included from psutil/_psutil_linux.c:19:
psutil/_psutil_linux.h:11: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:12: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:13: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:14: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:15: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:16: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.h:17: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: 在函数‘ioprio_get’中:
psutil/_psutil_linux.c:32: 警告:隐式声明函数‘syscall’
psutil/_psutil_linux.c: 在文件层:
psutil/_psutil_linux.c:52: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:75: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:100: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:150: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:172: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:192: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:213: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c:261: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:285: 错误:expected specifier-qualifier-list before ‘PyObject’
psutil/_psutil_linux.c: 在函数‘init_psutil_linux’中:
psutil/_psutil_linux.c:335: 错误:‘PyObject’未声明(在此函数内第一次使用)
psutil/_psutil_linux.c:335: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
psutil/_psutil_linux.c:335: 错误:所在的函数内也只报告一次。)
psutil/_psutil_linux.c:335: 错误:‘module’未声明(在此函数内第一次使用)
psutil/_psutil_linux.c:335: 警告:隐式声明函数‘Py_InitModule’
psutil/_psutil_linux.c:335: 错误:‘PsutilMethods’未声明(在此函数内第一次使用)
error: command 'gcc' failed with exit status 1
===============================================================
解决方法是安装python-devel,这是Python的头文件和静态库包:
1.可以先查看一下含python-devel的包
yum search python | grep python-devel
2.64位安装python-devel.x86_64,32位安装python-devel.i686,我这里安装:
sudo yum install python-devel.x86_64
相关文章推荐
- Python 解析配置模块之ConfigParser详解
- python学习(六):面向对象
- UnicodeDecodeError: 'utf8' codec can't decode byte pytho控制台输入参数编码问题
- 用Python实现斐波那契(Fibonacci)函数
- python2.7: open()文件处理使用介绍
- 备忘录 - numpy基本方法总结
- python常用函数(zip,map,filter,reduce)
- python metaclass 入门简介
- python正则表达式re匹配模式和特殊字符集
- 安装win32com报错-Python Version 2.7 required which was not found in the registry 问题解决 .
- python2.7:文件编码检测chardet 详解
- python2.7:urllib 和urllib2之间的区别
- Python基础教程之正则表达式基本语法以及re模块
- python安装MySQLdb模块-(ubuntu,windows)
- python函数里面的装饰器和闭包的理解
- Python中的sorted函数以及operator.itemgetter函数
- python2.7:IOError: [Errno 2] No such file or directory:
- python 如何重载模块,用一个简单的例子来解释
- PHP + PYTHON 多任务多线程,后台运行,计划任务-实现方法
- Python信号处理模块signal