import os,sys,os.path self_path = os.path.join(os.getcwd(), __file__) self_dir = os.path.join(os.path.dirname(self_path), os.path.pardir) os.chdir(self_dir) sys.path.append(os.path.join(self_dir, 'lib')) if (os.path.isdir('/Users/deusx/local/lib/')): sys.path.append('/Users/deusx/local/lib/python') sys.path.append('/Users/deusx/local/lib/python2.3/site-packages')