LykosAI/StabilityMatrix · error · MissingPrerequisiteException
Could not find Visual Studio 2022 Build Tools. Please…
Error message
Could not find Visual Studio 2022 Build Tools. Please install them from the link below.
What it means
When no prebuilt wheels are available, InstallSageAttentionStep falls back to compiling from source, which requires Visual Studio 2022 Build Tools. If prerequisiteHelper.IsVcBuildToolsInstalled is false, MissingPrerequisiteException is thrown with the download link.
Solutions
- Install VS2022 Build Tools from https://aka.ms/vs/17/release/vs_BuildTools.exe (include C++ workload)
- Rerun the install step after Build Tools are present
- Use a Python version for which prebuilt SageAttention wheels exist to avoid compilation
Defensive patterns
Strategy: validation
Validate before calling
if (!prerequisiteHelper.IsVcBuildToolsInstalled)
await installer.LaunchVsBuildToolsSetup(); Try / catch
try { await step.ExecuteAsync(progress); } catch (MissingPrerequisiteException ex) { ui.ShowPrerequisiteDialog(ex.Name, ex.Message, ex.Url); } Prevention
- Run a prerequisite check (Build Tools, CUDA) before source builds
- Prefer Python versions with prebuilt wheels to avoid compilation
- Prompt users to install Build Tools early in setup
When it happens
Trigger: ExecuteAsync on Windows with no matching prebuilt wheels and no VS2022 Build Tools installed, so compilation prerequisites are missing.
Common situations: Fresh Windows installs without development tools; users declined Build Tools during earlier setups; CUDA/torch source builds triggered by unusual Python versions lacking wheels.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- Could not find CUDA Toolkit. Please install version 12.6 or…
- This method of installing Triton and SageAttention is only…
- Windows ROCm package commands are only supported on Windows.
- Service type is not assignable to
- Service of type is not registered for
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/4fabdce41ec8fc49.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs:142
var pipArgs = new PipInstallArgs("triton-windows");
if (!string.IsNullOrWhiteSpace(sageWheelUrl))
{
pipArgs = pipArgs.AddArg(sageWheelUrl);
progress?.Report(
new ProgressReport(-1f, message: "Installing Triton & SageAttention", isIndeterminate: true)
);
await venvRunner.PipInstall(pipArgs, progress.AsProcessOutputHandler()).ConfigureAwait(false);
return;
}
// no wheels, gotta build
if (!prerequisiteHelper.IsVcBuildToolsInstalled)
{
throw new MissingPrerequisiteException(
"Visual Studio 2022 Build Tools",
"Could not find Visual Studio 2022 Build Tools. Please install them from the link below.",
"https://aka.ms/vs/17/release/vs_BuildTools.exe"
);
}
var nvccPath = await Utilities.WhichAsync("nvcc").ConfigureAwait(false);
if (string.IsNullOrWhiteSpace(nvccPath))
{
var cuda126ExpectedPath = new DirectoryPath(
@"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin"
);
var cuda128ExpectedPath = new DirectoryPath(
@"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin"
);
if (!cuda126ExpectedPath.Exists && !cuda128ExpectedPath.Exists)
{View on GitHub (pinned to af93d6ef57)