Direct answer
For binary‑dependency recovery, a Conda revision rollback is more reliable only if the local package cache still contains the exact builds that were previously installed. When the cache is intact, rolling back restores the precise binaries that Conda originally fetched. A venv recreate from requirements.txt will always reinstall the latest compatible wheels (or source builds) available at recreation time, which can differ in ABI or version, making it less reliable for binary‑specific reproducibility.
Regarding disk overhead, Conda’s package cache (typically several hundred megabytes to a few gigabytes) adds a fixed cost per workstation, while each venv occupies only the space of its installed packages. The cache becomes a limiting factor when you maintain many environments or when total available storage is constrained; roughly, once the cache exceeds ~5 GB or you need to keep more than 10–20 isolated environments on the same disk, the overhead outweighs the benefit of instant rollback.
Confirmed facts
- Conda records each transaction as a revision (
conda list --revisions) and can attempt to revert with conda install --revision N.
- The rollback succeeds only when the packages involved in that revision are still present in the local package cache (
conda clean --packages removes them and makes rollback impossible).
- A
venv stores absolute paths to the Python interpreter; the supported recovery path is deleting the directory and running python -m venv .venv && pip install -r requirements.txt.
- Recreating a venv reproduces exactly what is pinned in
requirements.txt but does not capture the Python interpreter version, system libraries, or packages installed via pip inside a conda env.
Steps for this case
- Check whether the package cache is intact:
conda clean --info shows the cache size and location; if it has been recently cleaned, assume older revisions may be missing.
- If the cache is intact and you need to revert a recent failed upgrade:
conda list --revisions # note the revision number before the failure
conda install --revision <N> # roll back to that state
- If the cache has been pruned or you cannot guarantee its contents, fall back to venv‑style recovery:
# remove the broken environment
rm -rf /path/to/env
# recreate from a pinned requirements.txt
python -m venv /path/to/env
source /path/to/env/bin/activate
pip install -r requirements.txt
- Verify recovery:
- For conda:
conda list and compare output to the expected revision.
- For venv:
pip freeze and diff against the original requirements.txt.
When to ask for more detail
If you are uncertain whether the package cache has been cleared (e.g., after a conda clean --packages or automated cleanup), please confirm the cache state before deciding to rely on revision rollback; this detail changes the recommendation from "use rollback" to "recreate the environment".