Back to Cookbook

Conda Solver Triage & Environment Stabilization

Turn "Solving environment…" hangs into a deterministic fix workflow.

Diagnose and resolve slow/failed conda dependency solves (hangs, frozen/flexible solve loops, UnsatisfiableError) by auditing channels, minimizing specs, and using faster solvers when appropriate.

CommunitySubmitted by CommunityWork10 min

INGREDIENTS

🐙GitHub🔍Web

PROMPT

You are OpenClaw. Ask for the exact conda command, OS, and outputs of: conda info; conda config --show; conda list --explicit. Then guide the user through a minimal-repro env, channel cleanup, solver choice (mamba/libmamba), and incremental dependency addition. Output a cleaned environment.yml and a short checklist to prevent recurrence.

Pain point

Conda installs can hang at "Solving environment…" or fail with UnsatisfiableError, especially when

environments have accumulated mixed channels, overly broad version specs, or pip-installed packages.

Where it happens: computational research (local, VM, HPC) when bootstrapping or updating toolchains.

Repro/diagnostic steps

  1. Capture: `conda info`, `conda config --show`, `conda list --explicit`, and the exact failing command.
  2. Identify: channels + priority, Python version, and whether pip has been used inside the env.

Root causes (common)

  • Channel mixing and inconsistent priority settings.
  • Overly permissive or conflicting version constraints.
  • Large, "kitchen sink" environments instead of task-specific envs.
  • pip-installed packages complicating solver expectations.

Fix workflow

  1. Create a *minimal* new env (pin Python + 1–2 core deps) and verify the solver is healthy.
  2. If solves are slow, use mamba/libmamba as a drop-in solver and reduce the spec surface area.
  3. Standardize channels (choose a primary ecosystem, avoid ad-hoc mixing).
  4. Add dependencies incrementally (binary search conflicts).
  5. Export a lock-style spec once stable; avoid piecemeal upgrades in production envs.

Expected result

  • Environment solves complete consistently (minutes, not hours).
  • Recreating the env from `environment.yml` yields the same working stack.

References

  • https://docs.conda.io/docs/user-guide/tasks/manage-channels.html
  • https://github.com/conda/conda/issues/8051
  • https://bioconda.github.io/faqs.html
  • https://stackoverflow.com/questions/74781771/how-we-can-resolve-solving-environment-failed-with-initial-frozen-solve-retry/76799565
Tags:#python#reproducibility#environments#hpc