def METHOD_NAME(pkg_name: str) -> bool:
    import importlib
    try:
        spec = importlib.util.find_spec(pkg_name)
    except (ModuleNotFoundError, AttributeError):
        return False
    finally:
        return spec is not None