def isInstalled(module_name):
    """Check if a required package is installed, by trying to import it."""

    try:
        return __import__(module_name)
    except ImportError:
        return False
    else:
        return True