zoukankan      html  css  js  c++  java
  • 安装psutil模块报错&安装python-devel

    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

  • 相关阅读:
    如何辨别护照的种类
    C#枚举中使用Flags特性
    那些年,我们一起学WCF--(7)PerSession实例行为
    64位系统使用Access 数据库文件的彻底解决方法
    从Excel中导入数据时,提示“未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序”的解决办法
    TortoiseSVN与VisualSVN Server搭建SVN版本控制系统
    解决Winform程序在不同分辨率系统下界面混乱
    【已解决】Https请求——基础连接已经关闭 发送时发生错误
    Entity Framework Code First学习系列目录
    PowerDesigner之PDM(物理概念模型)各种属性建立如PK,AK等
  • 原文地址:https://www.cnblogs.com/bethal/p/5318725.html
Copyright © 2011-2022 走看看