Diagnosing and Fixing Conda 'Solving Environment' Hangs and UnsatisfiableErrors
Learn how to diagnose and fix Conda's 'Solving environment' hangs and UnsatisfiableErrors using the libmamba solver, strict channel priority, and environment isolation.
27 Mar 2026, 22:32 UTC

The Problem: Solver Stalls and Dependency Conflicts
When running conda install or conda create, users frequently encounter two distinct failure states: the solver hangs indefinitely at "Solving environment," or it terminates with a massive UnsatisfiableError. Both indicate that the SAT solver (the engine that calculates compatible package versions) is struggling to find a valid set of dependencies that satisfy all constraints.
The takeaway: Most solver issues are caused by constraint explosion (too many packages in one environment), channel mixing (conflicting binaries from defaults and conda-forge), or using the legacy classic solver which is significantly slower than modern alternatives.
Diagnostic Matrix
Use this table to identify your specific condition and the most likely architectural cause.
| Symptom | Likely Cause | Primary Diagnostic Indicator |
|---|---|---|
| Infinite "Solving environment" spinner | Legacy solver or bloated base environment | Conda version < 23.1.0 or conda config --show solver is not libmamba |
UnsatisfiableError (Conflict report) |
Channel mismatch or overly strict version pins | Conflict report lists packages from both pkgs/main and conda-forge |
PackagesNotFoundError |
Missing channel or incompatible OS/Python version | Package exists on Anaconda.org but not in current channel_priority list |
Step-by-Step Diagnostic Workflow
Follow these checks in order to isolate whether the problem is the tool, the configuration, or the requested package set.
1. Verify Solver and Version
First, determine if you are using the legacy solver. Modern Conda versions use libmamba, which is written in C++ and solves environments orders of magnitude faster.
# Run on your terminal/shell
conda --version
conda config --show solver
Risk: If your version is very old, updating Conda itself may trigger a long solve. If you are stuck, try installing mamba as a standalone binary first.
2. Test for Constraint Explosion
If you are installing into the base environment, you are fighting against every pre-installed Anaconda package. Test if the issue is environment-specific by attempting a minimal dry-run in a fresh environment.
# Replace 3.x with your required version
conda create -n diag_test python=3.10 <your-package-name> --dry-run -vv
The -vv flag provides verbose output. If this succeeds quickly, your base environment is too bloated to be modified safely.
3. Inspect Channel Priority
Mixing the defaults channel (managed by Anaconda Inc.) and conda-forge (community-led) often leads to ABI (Application Binary Interface) conflicts, as they may compile the same library against different C-runtimes.
conda config --show channel_priority
If priority is flexible, Conda may pick a version from a lower-priority channel that breaks a dependency from a higher-priority one.
Applied Fixes
Fix A: Switch to the libmamba Solver
If you are on Conda 23.1.0+ but the solver is still slow, explicitly enable the faster solver:
conda config --set solver libmamba
Fix B: Resolve Channel Conflicts
To prevent the solver from jumping between channels and creating unsatisfiable states, enforce strict priority. This forces Conda to prioritize the top-most channel for all dependencies of a package.
conda config --set channel_priority strict
Recommendation: For most data science projects, use conda-forge as the primary channel and avoid defaults entirely in that specific environment.
Fix C: Loosen Version Pins
If an UnsatisfiableError persists, check your environment.yml. Avoid pinning to the exact build string (e.g., numpy=1.21.2=py39h...). Instead, pin to the major or minor version.
Comparison: Bad vs. Good Pinning
- Too Strict:
pandas==1.3.5(Can cause conflicts if another package requires>=1.4) - Balanced:
pandas>=1.3,<2.0(Allows the solver to find a compatible version within a stable API range)
Verification and Rollback
To verify the fix, run the installation again with the --dry-run flag. This simulates the transaction without changing your disk state.
conda install <package> --dry-run
If the solve completes in seconds and lists the packages to be installed, the configuration is corrected. To capture this clean state for others, use conda env export --from-history. This exports only the packages you explicitly requested, rather than every transitive dependency, which prevents "dependency hell" when sharing files.
Rollback: To revert solver or priority changes:
conda config --remove-key solver
conda config --set channel_priority flexible
Escalation Criteria
If the following conditions are met, the issue is likely a genuine package incompatibility rather than a solver failure:
- A
conda create --dry-runin a fresh environment still produces anUnsatisfiableError. - The conflict report shows two packages requiring different, non-overlapping versions of a core library (e.g., one requires
openssl 1.1and anotheropenssl 3.0). - The package is not available for your specific Python version (check the
pythonversion in the conflict report).
In these cases, you must either relax your version requirements, find an alternative package, or split the dependencies into two separate environments.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.