{"record":{"id":"ff6fbfcf1160c237","repo":"LykosAI/StabilityMatrix","slug":"unsupported-python-version-version","errorCode":null,"errorMessage":"Unsupported Python version: {version}","messagePattern":"Unsupported Python version: (.+?)","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs","lineNumber":107,"sourceCode":"        Path.Combine(AssetsDir, Compat.IsMacOS ? \"ffmpeg.zip\" : \"ffmpeg.tar.xz\");\n    private DirectoryPath FfmpegExtractPath => AssetsDir.JoinDir(\"ffmpeg\");\n    public string FfmpegPath =>\n        Compat.IsMacOS\n            ? Path.Combine(FfmpegExtractPath, \"ffmpeg\")\n            : Path.Combine(FfmpegExtractPath, \"bin\", \"ffmpeg\");\n    public bool IsFfmpegInstalled => File.Exists(FfmpegPath);\n\n    public DirectoryPath DotnetDir => AssetsDir.JoinDir(\"dotnet\");\n\n    // Helper method to get Python download URL for a specific version\n    private RemoteResource GetPythonDownloadResource(PyVersion version)\n    {\n        if (version == PyInstallationManager.Python_3_10_11)\n        {\n            return Assets.PythonDownloadUrl;\n        }\n\n        throw new ArgumentException($\"Unsupported Python version: {version}\", nameof(version));\n    }\n\n    // Helper method to get download path for a specific Python version\n    private string GetPythonDownloadPath(PyVersion version) =>\n        Path.Combine(AssetsDir, $\"python-{version}-amd64.tar.gz\");\n\n    private async Task<bool> CheckIsGitInstalled()\n    {\n        var result = await ProcessRunner.RunBashCommand(\"git --version\");\n        isGitInstalled = result.ExitCode == 0;\n        return isGitInstalled == true;\n    }\n\n    public Task InstallPackageRequirements(\n        BasePackage package,\n        PyVersion? pyVersion = null,\n        IProgress<ProgressReport>? progress = null\n    ) => InstallPackageRequirements(package.Prerequisites.ToList(), pyVersion, progress);","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs#L89-L125","documentation":"GetPythonDownloadResource maps a known PyVersion to a baked-in download asset URL. Only Python 3.10.11 (PyInstallationManager.Python_3_10_11) has a bundled Unix download URL; any other version has no asset and ArgumentException is thrown naming the unsupported version.","triggerScenarios":"A package's venv requirements request a Python version other than 3.10.11 on Unix, so GetPythonDownloadResource is called (via remote download path) with e.g. 3.11.x and hits the throw.","commonSituations":"Installing a package whose python version is 3.9/3.11/3.12 on Linux/macOS; a newer app release or user-edited package config adds a Python version that the assets haven't been updated to bundle.","solutions":["Set the package's Python version to 3.10.11 (the only bundled Unix build) in the package's venv requirements.","Update to a Stability Matrix build whose assets include a download URL for the requested Python version.","Use the Windows release (WindowsPrerequisiteHelper) if you need other versions, or install the needed Python via the package's own scripts.","File/patch PyInstallationManager to add a PyVersion + asset URL for the requested version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var supported = version == PyInstallationManager.Python_3_10_11;\nif (!supported) throw new NotSupportedException($\"Python {version} has no bundled Unix asset; use 3.10.11\");","typeGuard":"bool IsSupportedUnixPython(PyVersion v) => v == PyInstallationManager.Python_3_10_11;","tryCatchPattern":"try { url = helper.GetPythonDownloadResource(version); }\ncatch (ArgumentException ex) when (ex.ParamName == \"version\")\n{ logger.Error($\"Python {version} unsupported on Unix; falling back to 3.10.11\"); }","preventionTips":["Pin package venv requirements to Python 3.10.11 on Unix targets.","Check PyInstallationManager for the set of versions with bundled assets before choosing a version.","Keep Stability Matrix updated so newly supported Python versions are available."],"tags":["python","unsupported-version","argument-validation","unix","prerequisites"],"backgroundTag":"unsupported-enum-value","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"}