what about:
def module_is_available(the_path,module_folder_name):
return module_folder_name in os.listdir(the_path)
or if you want to check all paths currently in sys.path:
def module_is_available_in_sys_path(module_folder_name):
for p in sys.path:
if module_is_available(p,module_folder_name)
return True
return False