linux下安装easy_install、pip和psutil模块

简介: 1.上传软件setuptools-25.2.0.tar.gz   tar xvf setuptools-25.2.0.tar.gz    //解压软件lscd setuptools-25.2.0 //进入目录进入目录python setup.

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


目录
相关文章
|
22天前
|
测试技术 Linux
Linux(8)Debain系统测试EC25-EUX模块usbnet0(qmi qcm)问题点
Linux(8)Debain系统测试EC25-EUX模块usbnet0(qmi qcm)问题点
38 0
|
2月前
|
存储 Shell Linux
【Shell 命令集合 系统设置 】Linux 生成并更新内核模块的依赖 depmod命令 使用指南
【Shell 命令集合 系统设置 】Linux 生成并更新内核模块的依赖 depmod命令 使用指南
41 0
|
2月前
|
Shell Linux C语言
【Shell 命令集合 系统设置 】⭐Linux 卸载已加载的内核模块rmmod命令 使用指南
【Shell 命令集合 系统设置 】⭐Linux 卸载已加载的内核模块rmmod命令 使用指南
46 1
|
2月前
|
存储 Linux Shell
【Shell 命令集合 系统设置 】Linux 获取指定模块的元信息 minfo命令 使用指南
【Shell 命令集合 系统设置 】Linux 获取指定模块的元信息 minfo命令 使用指南
33 0
|
4月前
pip install -U weditor 安装报错 error: subprocess-exited-with-error
pip install -U weditor 安装报错 error: subprocess-exited-with-error
91 0
|
2月前
|
Linux Shell 文件存储
【Shell 命令集合 系统设置 】Linux 加载和卸载内核模块 modprobe命令 使用指南
【Shell 命令集合 系统设置 】Linux 加载和卸载内核模块 modprobe命令 使用指南
57 1
|
21天前
|
Linux
Linux(23) Linux 4G模块不能获取IP排查思路
Linux(23) Linux 4G模块不能获取IP排查思路
36 0
|
1月前
|
Linux 编译器 C语言
QT编译安装QtMqtt子模块,Linux平台
QT编译安装QtMqtt子模块,Linux平台
|
2月前
|
应用服务中间件 Linux PHP
Linux下安装php环境并且配置Nginx支持php-fpm模块
Linux下安装php环境并且配置Nginx支持php-fpm模块
34 0
|
2月前
|
存储 Linux Shell
【Shell 命令集合 系统设置 】Linux 显示Linux内核模块的详细信息 modinfo命令 使用指南
【Shell 命令集合 系统设置 】Linux 显示Linux内核模块的详细信息 modinfo命令 使用指南
30 0