{"record":{"id":"37dbfff78690941d","repo":"LykosAI/StabilityMatrix","slug":"installed-sageattention-package-path-was-not-found-at","errorCode":null,"errorMessage":"Installed SageAttention package path was not found at '{sageAttentionDir.FullPath}'.","messagePattern":"Installed SageAttention package path was not found at '(.+?)'\\.","errorType":"exception","errorClass":"DirectoryNotFoundException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/PackageModification/InstallWindowsRocmPackageCommandStep.cs","lineNumber":176,"sourceCode":"\n        progress?.Report(\n            new ProgressReport(\n                -1f,\n                \"Installing triton-windows for Windows ROCm SageAttention...\",\n                isIndeterminate: true\n            )\n        );\n        await venvRunner.PipInstall($\"triton-windows=={TritonWindowsVersion}\").ConfigureAwait(false);\n\n        progress?.Report(\n            new ProgressReport(-1f, \"Installing SageAttention for Windows ROCm...\", isIndeterminate: true)\n        );\n        await venvRunner.PipInstall($\"--no-deps sageattention=={SageAttentionVersion}\").ConfigureAwait(false);\n\n        var sageAttentionDir = WorkingDirectory.JoinDir(\"venv\", \"Lib\", \"site-packages\", \"sageattention\");\n        if (!sageAttentionDir.Exists)\n        {\n            throw new DirectoryNotFoundException(\n                $\"Installed SageAttention package path was not found at '{sageAttentionDir.FullPath}'.\"\n            );\n        }\n\n        progress?.Report(\n            new ProgressReport(-1f, \"Patching SageAttention for Windows ROCm...\", isIndeterminate: true)\n        );\n\n        await DownloadAndReplaceFileAsync(\n                sageAttentionDir,\n                \"attn_qk_int8_per_block.py\",\n                AttnQkInt8PerBlockUrl,\n                progress\n            )\n            .ConfigureAwait(false);\n        await DownloadAndReplaceFileAsync(\n                sageAttentionDir,\n                \"attn_qk_int8_per_block_causal.py\",","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/PackageModification/InstallWindowsRocmPackageCommandStep.cs#L158-L194","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["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.","Check disk space and antivirus exclusions for the package directory, recreate the venv if corrupted, then retry.","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.","Update the app in case a newer version fixed the pip invocation or path handling for the venv layout."],"exampleFix":"// before\nawait venvRunner.PipInstall(\"--no-deps sageattention==1.0.6\");\n// assume directory exists\n// after\nawait venvRunner.PipInstall(\"--no-deps sageattention==1.0.6\");\nvar dir = Path.Combine(workingDirectory, \"venv\", \"Lib\", \"site-packages\", \"sageattention\");\nif (!Directory.Exists(dir))\n    throw new InvalidOperationException($\"sageattention install failed; check pip logs ({dir})\");","handlingStrategy":"try-catch","validationCode":"var sageDir = Path.Combine(workingDirectory, \"venv\", \"Lib\", \"site-packages\", \"sageattention\");\nif (!Directory.Exists(sageDir))\n    Console.WriteLine($\"sageattention not installed at {sageDir}; check pip output before patching.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await step.ExecuteAsync(progress);\n}\ncatch (DirectoryNotFoundException ex) when (ex.Message.Contains(\"SageAttention\"))\n{\n    // inspect pip logs, reinstall sageattention into the venv, retry\n}","preventionTips":["Verify pip install exit/output before assuming the package landed in site-packages.","Keep enough free disk space and exclude the package dir from antivirus interference.","Use the app-managed venv (standard Lib/site-packages layout) rather than custom layouts.","Pin sageattention==1.0.6 and confirm wheel compatibility with the venv's Python version."],"tags":["directory-not-found","pip","sageattention","venv","rocm"],"backgroundTag":"directory-not-found","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}