LykosAI/StabilityMatrix · error · DirectoryNotFoundException

Installed SageAttention package path was not found at

Error message

Installed SageAttention package path was not found at '{sageAttentionDir.FullPath}'.

What it means

After pip-installing sageattention 1.0.6 with --no-deps into the package venv, the step expects the module directory at 'venv/Lib/site-packages/sageattention' to exist so it can patch files for Windows ROCm. If pip succeeded but the directory is missing at that hardcoded path, it throws DirectoryNotFoundException. This usually indicates the install silently failed, installed elsewhere, or the venv layout differs.

Solutions

  1. Run '<venv>/Scripts/python -m pip install --no-deps sageattention==1.0.6' manually inside the venv and check pip output for errors, then retry the step.
  2. Check disk space and antivirus exclusions for the package directory, recreate the venv if corrupted, then retry.
  3. Verify the folder ven/<root>/venv/Lib/site-packages/sageattention exists after install; if pip installed to user site, reinstall with the venv's pip.
  4. Update the app in case a newer version fixed the pip invocation or path handling for the venv layout.

Example fix

// before
await venvRunner.PipInstall("--no-deps sageattention==1.0.6");
// assume directory exists
// after
await venvRunner.PipInstall("--no-deps sageattention==1.0.6");
var dir = Path.Combine(workingDirectory, "venv", "Lib", "site-packages", "sageattention");
if (!Directory.Exists(dir))
    throw new InvalidOperationException($"sageattention install failed; check pip logs ({dir})");
Defensive patterns

Strategy: try-catch

Validate before calling

var sageDir = Path.Combine(workingDirectory, "venv", "Lib", "site-packages", "sageattention");
if (!Directory.Exists(sageDir))
    Console.WriteLine($"sageattention not installed at {sageDir}; check pip output before patching.");

Try / catch

try
{
    await step.ExecuteAsync(progress);
}
catch (DirectoryNotFoundException ex) when (ex.Message.Contains("SageAttention"))
{
    // inspect pip logs, reinstall sageattention into the venv, retry
}

Prevention

When it happens

Trigger: PipInstall for sageattention fails or resolves to a different location (different Python layout, pip installing to user site, network/proxy returning success but empty wheel), or the venv uses a layout other than Lib/site-packages (e.g. custom venv, non-Windows-style paths).

Common situations: Corporate proxy letting pip fail silently; disk full during pip install; venv created with unusual Python distribution; package's venv recreated by another tool with different structure; antivirus blocking the sageattention folder creation.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/37dbfff78690941d. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Core/Models/PackageModification/InstallWindowsRocmPackageCommandStep.cs:176

        progress?.Report(
            new ProgressReport(
                -1f,
                "Installing triton-windows for Windows ROCm SageAttention...",
                isIndeterminate: true
            )
        );
        await venvRunner.PipInstall($"triton-windows=={TritonWindowsVersion}").ConfigureAwait(false);

        progress?.Report(
            new ProgressReport(-1f, "Installing SageAttention for Windows ROCm...", isIndeterminate: true)
        );
        await venvRunner.PipInstall($"--no-deps sageattention=={SageAttentionVersion}").ConfigureAwait(false);

        var sageAttentionDir = WorkingDirectory.JoinDir("venv", "Lib", "site-packages", "sageattention");
        if (!sageAttentionDir.Exists)
        {
            throw new DirectoryNotFoundException(
                $"Installed SageAttention package path was not found at '{sageAttentionDir.FullPath}'."
            );
        }

        progress?.Report(
            new ProgressReport(-1f, "Patching SageAttention for Windows ROCm...", isIndeterminate: true)
        );

        await DownloadAndReplaceFileAsync(
                sageAttentionDir,
                "attn_qk_int8_per_block.py",
                AttnQkInt8PerBlockUrl,
                progress
            )
            .ConfigureAwait(false);
        await DownloadAndReplaceFileAsync(
                sageAttentionDir,
                "attn_qk_int8_per_block_causal.py",

View on GitHub (pinned to af93d6ef57)