网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Python系统性能信息模块psutil安装报错解决一例

今天在执行python脚本时报如下错误:

[root@localhost ~]# python MySQL_watcher.py -p dbset.ini
Traceback (most recent call last):
  File "mysql_watcher.py", line 17, in
    import psutil
ImportError: No module named psutil


经查询,psutil是python的系统性能信息模块,正确的安装方法如下:


[root@localhost ~]# yum install python-setuptools
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirrors.btte.net
 * updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-setuptools.noarch 0:0.6.10-3.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================
 Package                                     Arch                             Version                                   Repository                      Size
=============================================================================================================================================================
Installing:
 python-setuptools                           noarch                           0.6.10-3.el6                              base                           336 k


Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)


Total download size: 336 k
Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
python-setuptools-0.6.10-3.el6.noarch.rpm                                                                                             | 336 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : python-setuptools-0.6.10-3.el6.noarch                                                                                                     1/1
  Verifying  : python-setuptools-0.6.10-3.el6.noarch                                                                                                     1/1


Installed:
  python-setuptools.noarch 0:0.6.10-3.el6


Complete!
[root@localhost ~]# easy_install psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Best match: psutil 5.2.2
Downloading https://pypi.python.org/packages/57/93/47a2e3befaf194ccc3d05ffbcba2cdcdd22a231100ef7e4cf63f085c900b/psutil-5.2.2.tar.gz#md5=bb98d48796cd76d9ccee871aad720f9c
Processing psutil-5.2.2.tar.gz
Running psutil-5.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-aRZwy3/psutil-5.2.2/egg-dist-tmp-EDoxRo
warning: manifest_maker: MANIFEST.in, line 14: 'recursive-include' expects ...
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*' found under directory '.ci'
psutil/_psutil_linux.c: In function ‘psutil_proc_cpu_affinity_set’:
psutil/_psutil_linux.c:426: warning: suggest explicit braces to avoid ambiguous ‘else’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:630: warning: unused variable ‘v’
Adding psutil 5.2.2 to easy-install.pth file


Installed /usr/lib/python2.6/site-packages/psutil-5.2.2-py2.6-linux-x86_64.egg
Processing dependencies for psutil
Finished processing dependencies for psutil


网页题目:Python系统性能信息模块psutil安装报错解决一例
本文路径:http://bjjierui.cn/article/jcodjg.html

其他资讯