{"record":{"id":"2be55680b39d217d","repo":"LykosAI/StabilityMatrix","slug":"python-pyversion-was-not-found-and-or-failed-to-install","errorCode":null,"errorMessage":"Python {pyVersion} was not found and/or failed to install. Please check the logs for more details.","messagePattern":"Python (.+?) was not found and/or failed to install\\. Please check the logs for more details\\.","errorType":"exception","errorClass":"MissingPrerequisiteException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs","lineNumber":146,"sourceCode":"        List<PackagePrerequisite> prerequisites,\n        PyVersion? pyVersion = null,\n        IProgress<ProgressReport>? progress = null\n    )\n    {\n        await UnpackResourcesIfNecessary(progress);\n        await InstallUvIfNecessary(progress);\n\n        if (prerequisites.Contains(PackagePrerequisite.Python310))\n        {\n            await InstallPythonIfNecessary(PyInstallationManager.Python_3_10_11, progress);\n            await InstallVirtualenvIfNecessary(PyInstallationManager.Python_3_10_11, progress);\n        }\n\n        if (pyVersion is not null)\n        {\n            if (!await EnsurePythonVersion(pyVersion.Value))\n            {\n                throw new MissingPrerequisiteException(\n                    @\"Python\",\n                    @$\"Python {pyVersion} was not found and/or failed to install. Please check the logs for more details.\"\n                );\n            }\n        }\n\n        if (prerequisites.Contains(PackagePrerequisite.Git))\n        {\n            await InstallGitIfNecessary(progress);\n        }\n\n        if (prerequisites.Contains(PackagePrerequisite.Node))\n        {\n            await InstallNodeIfNecessary(progress);\n        }\n\n        if (prerequisites.Contains(PackagePrerequisite.Dotnet))\n        {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs#L128-L164","documentation":"InstallPackageRequirements calls EnsurePythonVersion(pyVersion) to download/install the required Python build; when that returns false (download, hash, or extraction failed) it raises MissingPrerequisiteException for the 'Python' prerequisite, telling the user to check logs. It aggregates any underlying install failure into a single user-facing prerequisite error.","triggerScenarios":"Installing a package on Unix whose required Python version fails to download, fails SHA-256 verification, fails to extract, or has no bundled asset — EnsurePythonVersion returns false and this exception is thrown.","commonSituations":"Network failures or proxies blocking the Python tar.gz download; CDN/host serving an HTML error page (hash mismatch); missing asset for non-3.10.11 versions; corrupted archive from a partial download.","solutions":["Check Stability Matrix logs (Help > Open Logs) for the underlying download/hash/extract failure and retry after fixing connectivity.","Verify network access to the Python download URL (VPN/proxy/firewall) and retry the package install.","If the requested version isn't supported, change the package venv to Python 3.10.11.","Clear the partially downloaded python tar.gz under the Assets dir and reinstall."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check network access to the Python asset host before install\nusing var ping = new HttpClient();\nvar resp = await ping.GetAsync(assetUrl, HttpCompletionOption.ResponseHeadersRead);\nif (!resp.IsSuccessStatusCode || resp.Content.Headers.ContentLength is null or 0)\n    throw new Exception(\"Python asset unreachable; fix network before install\");","typeGuard":null,"tryCatchPattern":"try { await helper.InstallPackageRequirements(package, pyVersion, ct); }\ncatch (MissingPrerequisiteException ex)\n{ logger.Error(ex, \"Python prerequisite missing; see inner logs\"); NotifyUserToCheckLogs(); }","preventionTips":["Ensure stable internet and no interfering proxy before installing packages.","Read app logs for the underlying download/hash/extract failure.","Clean up partial downloads in the assets directory after failed installs.","Only request Python versions the app bundles for your platform."],"tags":["python","prerequisites","installation-failed","unix","missing-prerequisite"],"backgroundTag":"missing-dependency","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"}