LykosAI/StabilityMatrix · error · InvalidOperationException
Package not found or not installed correctly
Error message
Package not found or not installed correctly
What it means
FramePack's 'Install Triton and SageAttention' extra command throws InvalidOperationException when the installedPackage argument is null or its FullPath is empty. It's a guard ensuring the command only runs against an actually installed package with a valid install directory.
Solutions
- Reinstall or re-add the FramePack package so FullPath is populated, then rerun the command.
- Verify the package directory exists on disk; if moved, relocate it back or delete and reinstall.
- Remove the stale package entry from Stability Matrix and reinstall fresh.
- Run the Triton/SageAttention install only from the package card UI, not via stale references.
Defensive patterns
Strategy: type-guard
Validate before calling
if (installedPackage is not { FullPath: { Length: > 0 } })
{
// skip or prompt reinstall before invoking the extra command
} Type guard
bool IsUsablePackage(InstalledPackage? p) => p is { FullPath: { Length: > 0 } }; Try / catch
try { await command(installedPackage); }
catch (InvalidOperationException ex) when (ex.Message == "Package not found or not installed correctly")
{ PromptReinstall(); } Prevention
- Only run extra commands from the package card of an installed package
- Re-check package integrity after moving the library folder
- Clean up stale package records after failed installs
When it happens
Trigger: Invoking the extra command with a null package reference or a package record whose FullPath was never set (package registered but files missing/not installed).
Common situations: Package entry left over from a failed or deleted install; invoking the command from a stale UI state; database record missing FullPath after moving the library folder.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/72ae5c8e31d86177.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Core/Models/Packages/FramePack.cs:208
var match = regex.Match(s.Text);
if (match.Success)
WebUrl = match.Value;
OnStartupComplete(WebUrl);
}
}
public override List<ExtraPackageCommand> GetExtraCommands()
{
return Compat.IsWindows && SettingsManager.Settings.PreferredGpu?.IsAmpereOrNewerGpu() is true
?
[
new ExtraPackageCommand
{
CommandName = "Install Triton and SageAttention",
Command = async installedPackage =>
{
if (installedPackage == null || string.IsNullOrEmpty(installedPackage.FullPath))
throw new InvalidOperationException(
"Package not found or not installed correctly"
);
await InstallTritonAndSageAttention(installedPackage).ConfigureAwait(false);
},
},
]
: [];
}
private static string AddGradioAllowedPathsSupport(string originalContent)
{
// Add the --gradio-allowed-paths argument to the argument parser
var parserPattern =
@"(parser\.add_argument\(""--inbrowser"", action='store_true'\)\s*\n)(args = parser\.parse_args\(\))";
var parserReplacement =
"$1parser.add_argument('--gradio-allowed-paths', nargs='*', default=[], help='Allowed paths for Gradio file access')\n$2";
View on GitHub (pinned to af93d6ef57)