conda and pip interoperability in Anaconda environments: dependency ownership and metadata consistency
0 reputation · 17 Jul 2024, 16:22 UTC
An Anaconda environment is intended to be reproducible when both conda and pip are used as supported installers for the same prefix. The integration boundary between the two tools is documented, but the ownership model for shared dependencies remains ambiguous.
Conda maintains its own package metadata and pip maintains its own. The solvers operate independently, so a pip install can change a library that conda placed, and conda metadata does not record libraries installed by pip. Official guidance recommends installing as much as possible with conda first and using pip only for packages unavailable from conda channels, but the ordering is advisory rather than enforced.
With no single supported reconciliation mechanism, the environment can diverge between what conda reports and what is actually importable.
- What is the supported way to declare ownership for a dependency that exists in both conda and PyPI when both installers are used in the same environment?
- How does conda env export represent pip-installed packages, and what metadata is missing for full reproducibility?
- Is there a supported method to make conda metadata reflect pip changes without recreating the environment?