def require_dependencies(requirements: Union[str, List[str]], fn_name: Optional[str] = None) -> None:
    """
    Perform a runtime check of the dependency versions, using the exact same syntax used by pip.
    The installed module version comes from the *site-packages* dir via *importlib.metadata*.

    Args:
        requirements: pip style definition of dependencies, e.g. "tokenizers==0.9.4", "tqdm>=4.27", "numpy". Can either be a single dependency or a list of dependencies.
        fn_name: what suggestion to print in case of requirements not being met

    Example:
    ```python
    require_dependencies("pandas>1.1.2")
    require_dependencies("datasets>1.17.0", "from_datasets")
    require_dependencies(["pandas>1.1.2", "datasets>1.17.0"])
    ```
    """

    if isinstance(requirements, list):
        if len(requirements) == 0:
            raise ValueError("requirements cannot be an empty list.")
        for requirement in requirements:
            require_dependencies(requirement, fn_name=fn_name)
        return

    # non-versioned check
    if re.match(r"^[\w_\-\d]+$", requirements):
        package, op, want_version = requirements, None, None
    else:
        match = re.findall(r"^([^!=<>\s]+)([\s!=<>]{1,2}.+)", requirements)
        if not match:
            raise ValueError(
                "requirement needs to be in the pip package format, .e.g., package_a==1.23, or package_b>=1.23, but"
                f" got {requirements!r}."
            )
        package, want_full = match[0]
        want_range = want_full.split(",")  # there could be multiple requirements
        wanted = {}
        for w in want_range:
            match = re.findall(r"^([\s!=<>]{1,2})(.+)", w)
            if not match:
                raise ValueError(
                    "requirement needs to be in the pip package format, .e.g., package_a==1.23, or package_b>=1.23,"
                    f" but got {requirements!r}."
                )
            op, want_version = match[0]
            wanted[op] = want_version
            if op not in ops:
                raise ValueError(f"{requirements}: need one of {list(ops.keys())}, but got {op!r}.")

    # special case
    if package == "python":
        got_version = ".".join([str(x) for x in sys.version_info[:3]])
        for op, want_version in wanted.items():
            _compare_versions(op, got_version, want_version, requirements, package, fn_name=fn_name)
        return

    # check if any version is installed
    try:
        got_version = importlib.metadata.version(package)
    except importlib.metadata.PackageNotFoundError:
        raise ModuleNotFoundError(
            f"'{package}' must be installed{f' to use `{fn_name}`' if fn_name else ''}! You can"
            f" install '{package}' with this command: `pip install {requirements}`"
        )

    # check that the right version is installed if version number or a range was provided
    if want_version is not None:
        for op, want_version in wanted.items():
            _compare_versions(op, got_version, want_version, requirements, package, fn_name=fn_name)

    Perform a runtime check of the dependency versions, using the exact same syntax used by pip.
    The installed module version comes from the *site-packages* dir via *importlib.metadata*.

    Args:
        requirements: pip style definition of dependencies, e.g. "tokenizers==0.9.4", "tqdm>=4.27", "numpy". Can either be a single dependency or a list of dependencies.
        fn_name: what suggestion to print in case of requirements not being met

    Example:
    ```python
    require_dependencies("pandas>1.1.2")
    require_dependencies("datasets>1.17.0", "from_datasets")
    require_dependencies(["pandas>1.1.2", "datasets>1.17.0"])
    ```
    
argilla-v1/src/argilla_v1/utils/dependency.py