zoukankan      html  css  js  c++  java
  • linux下安装easy_install、pip和psutil模块

    1.上传软件setuptools-25.2.0.tar.gz

       tar xvf setuptools-25.2.0.tar.gz    //解压软件

    ls
    cd setuptools-25.2.0             //进入目录进入目录
    python setup.py install      //安装软件 
    easy_install pip          //安装pip安装工具
    pip install psutil         //安装psutil模块,psutil模块可以统计系统的cpu 内存和硬盘以及网络统计等等
     
    系统报错如下报错:
    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
     
    解决方法:
    error: command ‘gcc‘ failed with exit status 1

    安装 yum install gcc -y
    安装 yum install python-devel -y
    重新安装 pip install psutil 成功了ok


  • 相关阅读:
    windows10、windows server 2016激活方法
    .NET 和 .NET Core 使用 JWT 授权验证
    vs(vs2017、vs2019)离线安装包下载、制作
    VS顶部增加签名描述信息
    .NET WebAPI 跨域问题(has been blocked by CORS policy:No AccessControlAllowOgigin header is present on the requested resource)
    .Net 和 .Net Core 集成Swagger 以及配合JWT身份验证
    jQuery实现公告无限循环滚动
    甩掉 ashx/asmx,使用jQuery.ajaxWebService请求WebMethod,Ajax处理更加简练(转)
    JS和JQUERY常见函数封装方式
    第07组 Beta冲刺 (1/5)(组长)
  • 原文地址:https://www.cnblogs.com/enet01/p/6650277.html
Copyright © 2011-2022 走看看