def METHOD_NAME(
    dependencies: List[DependencyInfo],
):
    dependencies_to_install = get_deps_to_install(dependencies)
    if len(dependencies_to_install) == 0:
        return
    exit_code = subprocess.check_call(
        [
            python_path,
            "-m",
            "pip",
            "install",
            *[pin(dep_info) for dep_info in dependencies_to_install],
            "--disable-pip-version-check",
            "--no-warn-script-location",
        ]
    )
    if exit_code != 0:
        raise ValueError("An error occurred while installing dependencies.")
    for dep_info in dependencies_to_install:
        package_name = dep_info["package_name"]
        version = dep_info["version"]
        installed_packages[package_name] = version