psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes. It implements many functionalities offered by command line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap.
To install recent version of psutil first install python-dev module by using following command:
$ sudo apt-get install python-dev
Now install psutil with pip.
$ sudo pip install psutil
To upgrade psutil to recent version use following command:
$ sudo pip install psutil --upgrade
By any chance if there is no pip module in your machine, install pip with following command:
$ sudo apt-get install python-pip
I tested above commands in Ubuntu 12.04 LTS with python 2.7 version.