def METHOD_NAME(venv_dir: Path) -> VenvInfo:
    try:
        venv.create(venv_dir, with_pip=True, clear=True)
    except subprocess.CalledProcessError as e:
        if "ensurepip" in e.cmd and b"KeyboardInterrupt" not in e.stdout.splitlines():
            print_error(
                "stubtest requires a Python installation with ensurepip. "
                "If on Linux, you may need to install the python3-venv package."
            )
        raise
    return VenvInfo.of_existing_venv(venv_dir)