LykosAI/StabilityMatrix · error · ArgumentException

Unsupported Python version

Error message

Unsupported Python version: {version}

What it means

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.

Solutions

  1. Set the package's Python version to 3.10.11 (the only bundled Unix build) in the package's venv requirements.
  2. Update to a Stability Matrix build whose assets include a download URL for the requested Python version.
  3. Use the Windows release (WindowsPrerequisiteHelper) if you need other versions, or install the needed Python via the package's own scripts.
  4. File/patch PyInstallationManager to add a PyVersion + asset URL for the requested version.
Defensive patterns

Strategy: validation

Validate before calling

var supported = version == PyInstallationManager.Python_3_10_11;
if (!supported) throw new NotSupportedException($"Python {version} has no bundled Unix asset; use 3.10.11");

Type guard

bool IsSupportedUnixPython(PyVersion v) => v == PyInstallationManager.Python_3_10_11;

Try / catch

try { url = helper.GetPythonDownloadResource(version); }
catch (ArgumentException ex) when (ex.ParamName == "version")
{ logger.Error($"Python {version} unsupported on Unix; falling back to 3.10.11"); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12). Data as JSON: /api/errors/ff6fbfcf1160c237. Report an issue: GitHub.

Appendix: source

Thrown at StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs:107

        Path.Combine(AssetsDir, Compat.IsMacOS ? "ffmpeg.zip" : "ffmpeg.tar.xz");
    private DirectoryPath FfmpegExtractPath => AssetsDir.JoinDir("ffmpeg");
    public string FfmpegPath =>
        Compat.IsMacOS
            ? Path.Combine(FfmpegExtractPath, "ffmpeg")
            : Path.Combine(FfmpegExtractPath, "bin", "ffmpeg");
    public bool IsFfmpegInstalled => File.Exists(FfmpegPath);

    public DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");

    // Helper method to get Python download URL for a specific version
    private RemoteResource GetPythonDownloadResource(PyVersion version)
    {
        if (version == PyInstallationManager.Python_3_10_11)
        {
            return Assets.PythonDownloadUrl;
        }

        throw new ArgumentException($"Unsupported Python version: {version}", nameof(version));
    }

    // Helper method to get download path for a specific Python version
    private string GetPythonDownloadPath(PyVersion version) =>
        Path.Combine(AssetsDir, $"python-{version}-amd64.tar.gz");

    private async Task<bool> CheckIsGitInstalled()
    {
        var result = await ProcessRunner.RunBashCommand("git --version");
        isGitInstalled = result.ExitCode == 0;
        return isGitInstalled == true;
    }

    public Task InstallPackageRequirements(
        BasePackage package,
        PyVersion? pyVersion = null,
        IProgress<ProgressReport>? progress = null
    ) => InstallPackageRequirements(package.Prerequisites.ToList(), pyVersion, progress);

View on GitHub (pinned to af93d6ef57)