From d0812c2024a1f8edb081a2996af12efacdf8c961 Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Mon, 6 Sep 2010 22:08:29 +0200 Subject: [PATCH] Some distributions have a default distutils prefix which is not in sys.path, so installed modules cannot be imported. To address that, explicitely add the path where the module is supposed to be installed to sys.path. --- bin/iotop | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/iotop b/bin/iotop index c4aa720..e33dd41 100755 --- a/bin/iotop +++ b/bin/iotop @@ -6,6 +6,17 @@ import sys try: + from distutils.dist import Distribution + from distutils.command.install import install + install_cmd = install(Distribution()) + install_cmd.initialize_options() + install_cmd.finalize_options() + iotop_install_path = install_cmd.install_lib + sys.path.insert(0, iotop_install_path) +except Exception: + pass + +try: from iotop.ui import main except ImportError, e: print e -- 2.11.4.GIT