How to tell if an add on is present. Using Python
import addon_utils

addon_name = 'some_addon'

success = addon_utils.enable('some_addon')
if success:
    print("enabled", success.bl_info['name'])
else:
    print(addon_name, "is not found")


addon_utils.enable returns None if it failed to enable the addon, but returns a module reference (which evaluates to True) if it did manage to enable it.



The precise name of the addon is either:


the .py name if it's a single python file addon,
the directory name if it's directory based


Sometimes, especially prevalent with github .zips, the addon name is suffixed with -master. The addon name would then be 'some_addon-master'.



over the top, addon seeking

bpy.utils.script_paths() returns a list of directories where Blender looks for add-ons. With a bit of python-fu you can iterate through them and find any .py or sub-directories that contain part of an add-on name -- Then try to enable it :)