def install(help=False): this_dir = os.path.dirname(os.path.realpath(__file__)) # first we append the path with the management package # so we can import utils in the install module sys.path.append( os.path.join( this_dir, 'snodas', 'management', ) ) # then we add the commands package to the path # so we have access to the install module sys.path.append( os.path.join( this_dir, 'snodas', 'management', 'commands', ) ) # and lastly we add the directory of this file # to the path so we can import from setup.py sys.path.append( os.path.join( this_dir, ) ) from install import Install if help: Install.print_help(sys.argv[0], sys.argv[2]) else: Install.run_from_argv(sys.argv)