{"record":{"id":"6fcdb340cf6de49c","repo":"LykosAI/StabilityMatrix","slug":"uv-not-found","errorCode":null,"errorMessage":"uv not found","messagePattern":"uv not found","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Python/UvVenvRunner.cs","lineNumber":234,"sourceCode":"        cfg[\"home\"] = pythonDirectory;\n        cfg[\"base-prefix\"] = pythonDirectory;\n        cfg[\"base-exec-prefix\"] = pythonDirectory;\n        cfg[\"base-executable\"] = baseExecutable;\n        cfg.Save(cfgPath);\n\n        // Update last set path\n        lastSetPyvenvCfgPath = pythonDirectory;\n    }\n\n    /// <summary>\n    /// Run a pip install command. Waits for the process to exit.\n    /// workingDirectory defaults to RootPath.\n    /// </summary>\n    public async Task PipInstall(ProcessArgs args, Action<ProcessOutput>? outputDataReceived = null)\n    {\n        if (!File.Exists(UvExecutablePath))\n        {\n            throw new FileNotFoundException(\"uv not found\", UvExecutablePath);\n        }\n\n        SetPyvenvCfg(BaseInstall.RootPath);\n\n        // Record output for errors\n        var output = new StringBuilder();\n\n        var outputAction = new Action<ProcessOutput>(s =>\n        {\n            Logger.Debug($\"Pip output: {s.Text}\");\n            // Record to output\n            output.Append(s.Text);\n            // Forward to callback\n            outputDataReceived?.Invoke(s);\n        });\n\n        RunUvDetached(\n            args.Prepend([\"pip\", \"install\"])","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Python/UvVenvRunner.cs#L216-L252","documentation":"PipInstall() delegates to the uv binary expected at <GlobalConfig.LibraryDir>/Assets/uv/uv(.exe). If that file does not exist it throws FileNotFoundException before running the command. uv is a bundled asset that the app must download/extract beforehand.","triggerScenarios":"Calling PipInstall before the uv asset has been downloaded to LibraryDir/Assets/uv, or after the asset was deleted/corrupted, or on a platform where the expected uv.exe/uv filename is missing.","commonSituations":"Fresh install where asset download failed or was skipped; antivirus quarantining uv.exe; user manually cleaned the library Assets folder; portable install moved without Assets.","solutions":["Ensure the uv asset is downloaded/extracted to LibraryDir/Assets/uv before calling PipInstall","Check File.Exists on the uv path (respecting Compat.IsWindows) and trigger asset re-download if missing","Reinstall/repair the application library assets","Check antivirus quarantine for uv.exe and add an exclusion"],"exampleFix":"// before\nawait venv.PipInstall(new ProcessArgs(\"requests\"));\n// after\nvar uvPath = Path.Combine(GlobalConfig.LibraryDir, \"Assets\", \"uv\", Compat.IsWindows ? \"uv.exe\" : \"uv\");\nif (!File.Exists(uvPath))\n{\n    await assetDownloader.DownloadUvAsync(ct);\n}\nawait venv.PipInstall(new ProcessArgs(\"requests\"));","handlingStrategy":"validation","validationCode":"var uvPath = Path.Combine(GlobalConfig.LibraryDir, \"Assets\", \"uv\", Compat.IsWindows ? \"uv.exe\" : \"uv\");\nif (!File.Exists(uvPath))\n{\n    await assetManager.EnsureUvDownloadedAsync(cancellationToken);\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await venv.PipInstall(args);\n}\ncatch (FileNotFoundException e) when (e.FileName?.Contains(\"uv\") == true)\n{\n    await assetManager.EnsureUvDownloadedAsync(ct);\n    await venv.PipInstall(args); // retry once\n}","preventionTips":["Download the uv asset during app initialization before any venv operations","Periodically verify Assets/uv integrity","Whitelist uv in antivirus software","Never manually delete files under LibraryDir/Assets"],"tags":["python","uv","missing-binary","file-not-found"],"backgroundTag":"missing-dependency","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}