今天在执行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
================