[Conda] Error: CondaDependencyError — failed to resolve package dependencies — How to Fix It
Summary
The CondaDependencyError: failed to resolve package dependencies occurs when Conda’s solver cannot find a set of compatible package versions that meet all requirements. It often arises from conflicting version constraints, mixed channels (like defaults and conda-forge), or outdated metadata. The solution is to relax constraints, update Conda, or broaden your available repositories.
Context
Conda uses a dependency solver to ensure every installed package is compatible with the others in your environment. When two or more dependencies have incompatible version requirements — or when metadata is outdated — the solver fails. This issue is especially common when using strict version pins, old YAML environment files, or mixing channels with divergent dependency trees.
Probable Cause
- Strict version pins such as
python=3.9.0ornumpy=1.21.0blocking compatible builds. - Mixing the
defaultsandconda-forgechannels without priority control. - Outdated or corrupted Conda dependency metadata.
- Platform-specific packages included in a cross-platform YAML (e.g.,
pywin32on Linux). - Removed or deprecated builds no longer available in repositories.
Quick Fix
Apply the following steps to resolve dependency conflicts:
- Update Conda and its dependency metadata:
conda update conda
conda update --all
- Add the
conda-forgechannel and relax channel priority:
conda config --add channels conda-forge
conda config --set channel_priority flexible
- Relax version pins in your command or YAML file:
# Instead of:
python=3.9.0
numpy=1.21.0
# Use:
python=3.9
numpy
- Install packages incrementally to identify the conflict:
conda install numpy
conda install pandas
conda install scipy
If one of these fails, that’s the conflicting package.
- Try solving with Mamba for faster and clearer diagnostics:
conda install -n base -c conda-forge mamba
mamba install <package>
- If the environment is being created from YAML, remove OS-specific dependencies such as
pywin32orlibgcc-ng.
Full Example
Example error:
CondaDependencyError: failed to resolve package dependencies
UnsatisfiableError: The following specifications were found to be incompatible
- python=3.9.0
- tensorflow
Fix:
conda update conda
conda config --add channels conda-forge
conda config --set channel_priority flexible
conda create -n ml_env python=3.9 tensorflow
If this still fails, try a minimal environment first:
conda create -n base_test python=3.9 numpy
Pitfalls & Debug
- Symptom: “Unsatisfiable dependencies” → Fix: Relax strict pins and use flexible channel priority.
- Symptom: YAML-based environment creation fails → Fix: Remove OS-specific or legacy packages.
- Symptom: Repeated solver timeouts → Fix: Use
mambainstead of Conda for faster solving. - Symptom: PackagesNotFoundError → Fix: Check channel availability using
conda search <package>.
Validation & Next Steps
After adjustments, confirm that Conda resolves dependencies correctly:
conda search python
conda info
Recreate or install your environment cleanly:
conda create -n newenv python=3.11 pandas numpy
If successful, the solver will complete without dependency errors and your environment will initialize normally.
Sources
Anaconda Documentation — Package specifications and solver
conda-forge community — Tips for resolving dependency conflicts
Mamba documentation — high-performance Conda solver
Stack Overflow — troubleshooting UnsatisfiableError and solver issues