博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Centos7.x中安装psutil模块
阅读量:6862 次
发布时间:2019-06-26

本文共 1437 字,大约阅读时间需要 4 分钟。

一、window10操作系统(Python 3.6开发环境)安装psutil
D:\Program Files\python\Scripts>pip.exe install D:\python\psutil-5.2.2-cp36-cp36m-win_amd64.whl  Processing d:\python\psutil-5.2.2-cp36-cp36m-win_amd64.whl  Installing collected packages: psutil  Successfully installed psutil-5.2.2

二、Centos6.x系统安装psutil

[root@server psutil-2.0.0]# cat /etc/redhat-release CentOS release 6.6 (Final) 

1、安装psutil模块

wget https://pypi.python.org/packages/source/p/psutil/psutil-2.1.3.tar.gztar zxvf psutil-2.1.3.tar.gzcd psutil-2.1.3/python setup.py install

报错:

1、缺少gcc依赖环境  报错提示:

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o

unable to execute gcc: No such file or directory

error: command 'gcc' failed with exit status

2、解决:  yum -y install gcc

3、缺少python-dev依赖环境

 报错提示:  psutil/_psutil_linux.c:12:20: fatal error: Python.h: No such file or directory  

#include <Python.h>                     ^ compilation terminated. error: command 'gcc' failed with exit status 1

解决:  yum -y install python-devel.x86_64

总结:安装过程中,可能仍存在其它的环境依赖包情况。

转载地址:http://fxqyl.baihongyu.com/

你可能感兴趣的文章
PHP和JAVA整合开发的三个方案(六)
查看>>
重复提交问题(一)
查看>>
WPS 2019 去除自动升级 和 广告、及优化的点
查看>>
socket测试远程地址能否连接并为连接设置超时
查看>>
poj 2253 -- Frogger
查看>>
十分有趣的this指向题
查看>>
Git服务器安装详解及安装遇到问题解决方案
查看>>
asp.net mvc FluentValidation客户端验证失效
查看>>
【转载】VBA:调用文件夹对话框的几种方法
查看>>
【ocp-12c】最新Oracle OCP-071考试题库(38题)
查看>>
我为公司做的总体架构,欢迎提建议
查看>>
Apache的prefork模式和worker模式(转)
查看>>
android用于打开各种文件的intent
查看>>
PHP截取字符串
查看>>
php基础:变量,运算符总结
查看>>
函数和对象方法的区别
查看>>
程序猿装逼从注释开始
查看>>
寄存器AX
查看>>
javascript之复习(css属性值的计算)
查看>>
dijkstra算法与优先队列
查看>>