LykosAI/StabilityMatrix · error · ProcessException
install.py for exited with code
Error message
install.py for {installedDir.Name} exited with code {venvRunner.Process.ExitCode} What it means
ComfyUI.PostInstallAsync runs a custom node's install.py inside the package venv via venvRunner, waits for output EOF and process exit, and if the process exited nonzero throws ProcessException including the extension directory name and exit code. The library throws it because a failing install.py means the extension's own setup (often compilation of native deps) failed, so the extension cannot be considered installed or updated.
Solutions
- Read the full venv output logged before the exception (the script's stdout/stderr precedes the throw) to see the actual install.py failure, and fix that root cause (missing build tools, bad pip package, etc.).
- Install required build prerequisites: MSVC Build Tools/CUDA toolkit on Windows (or gcc/nvcc on Linux) if the log shows a compilation error.
- Retry the extension install/update — transient pip/network failures inside install.py often succeed on rerun.
- Pin the extension to a previous known-good commit/version if a recent upstream change broke install.py.
- Open an issue on the custom node's repo with the install.py output if the script itself is broken.
Example fix
// before: install.py fails with a compile error, exit code 1 await package.InstallExtensionAsync(installExtensionOptions, progress); // ProcessException: install.py for ComfyUI-Impact-Pack exited with code 1 // after: install MSVC Build Tools + CUDA toolkit, then rerun // log shows: cl.exe not found -> install "Desktop development with C++" workload await package.InstallExtensionAsync(installExtensionOptions, progress); // exit code 0
Defensive patterns
Strategy: try-catch
Try / catch
try
{
await package.InstallExtensionAsync(options, progress, ct);
}
catch (ProcessException ex)
{
logger.LogError(ex, "install.py failed for {Extension} (exit code in message); full script output was logged above",
options.ExtensionDirectoryName);
// inspect captured venv stdout/stderr for the root cause (build tools, pip, network) before retrying
} Prevention
- Capture and retain the venv process's stdout/stderr so the real install.py failure is diagnosable.
- Install compiler/CUDA build prerequisites (MSVC Build Tools + CUDA on Windows) before adding custom nodes that compile native code.
- Retry failed extension installs once — pip/network flakes inside install.py are common and transient.
- Pin custom nodes to known-good versions instead of tracking upstream HEAD for unattended updates.
When it happens
Trigger: Calling InstallExtensionAsync or UpdateExtensionAsync for a ComfyUI custom node whose repo contains install.py; the script runs under the venv and returns a nonzero exit code — e.g. pip dependency resolution failure inside install.py, a compiler error building CUDA/C++ sources, or a missing Python module invoked by the script.
Common situations: Custom node's install.py tries to build wheels and the machine lacks the right CUDA toolkit / MSVC build tools; install.py pins package versions conflicting with the ComfyUI venv's torch; upstream node repo updated install.py in a breaking way during UpdateExtensionAsync; no network access causes pip installs inside install.py to fail.
Related errors
- Install script failed with exit code
- Length cannot be null when latentType is Hunyuan
- Comfy client is not connected
- Git command [ ] failed with exit code
- RunNpm with args [ ] failed with exit code
AI-assisted analysis of LykosAI/StabilityMatrix@af93d6ef57 (2026-09-12).
Data as JSON: /api/errors/91d255682bd78948.
Report an issue: GitHub.
Appendix: source
Thrown at StabilityMatrix.Core/Models/Packages/ComfyUI.cs:998
env = env.SetItem("COMFYUI_PATH", installedPackage.FullPath!);
var modelPath =
installedPackage.PreferredSharedFolderMethod == SharedFolderMethod.None
? Path.Combine(installedPackage.FullPath!, "models")
: settingsManager.ModelsDirectory;
env = env.SetItem("COMFYUI_MODEL_PATH", modelPath);
return env;
});
venvRunner.RunDetached(["install.py"], progress.AsProcessOutputHandler());
await venvRunner.Process.WaitUntilOutputEOF(cancellationToken).ConfigureAwait(false);
await venvRunner.Process.WaitForExitAsync(cancellationToken).ConfigureAwait(false);
if (venvRunner.Process.HasExited && venvRunner.Process.ExitCode != 0)
{
throw new ProcessException(
$"install.py for {installedDir.Name} exited with code {venvRunner.Process.ExitCode}"
);
}
progress?.Report(new ProgressReport(1f, $"Ran launch.py for {installedDir.Name}"));
}
}
}
}
private async Task InstallTritonAndSageAttention(InstalledPackage? installedPackage)
{
if (installedPackage?.FullPath is null)
return;
var runner = new PackageModificationRunner
{
ShowDialogOnStart = true,View on GitHub (pinned to af93d6ef57)