[Conda] Error: CondaVerificationError — The package appears to be corrupted — How to Fix It

Summary

The CondaVerificationError: The package appears to be corrupted indicates that Conda detected a mismatch between a package’s actual files and its expected checksum or metadata. This typically means the package was incompletely downloaded, altered, or damaged after installation. The fix is to remove the corrupted package, clear the cache, and reinstall it to restore integrity.

Context

Each Conda package includes a checksum (e.g., MD5 or SHA256) used to verify that files remain unaltered. When these checksums fail verification, Conda raises this error to prevent using potentially broken or unsafe binaries. The issue often arises after network interruptions, antivirus interference, or manual edits inside the pkgs/ directory. A clean reinstall resolves nearly all occurrences.

Probable Cause

  • Interrupted or incomplete download of a package tarball.
  • Corrupted files in Conda’s pkgs/ cache directory.
  • File tampering or antivirus scanning during installation.
  • Outdated Conda version miscomputing checksums.
  • Manual edits to package files or metadata.

Quick Fix

Follow these steps to restore Conda’s package integrity:

  1. Identify the corrupted package from the error message (e.g. numpy-1.23.5-py311...).
  2. Clean Conda’s cache:
conda clean --packages --tarballs --yes
  1. If needed, manually delete the corrupted folder:
# Windows
C:\Users\\Anaconda3\pkgs\

# Linux/macOS
~/.conda/pkgs/
  1. Reinstall the package cleanly:
conda install 
  1. If corruption repeats, rebuild the cache fully:
conda clean --all
conda update conda
  1. Optionally switch to a stable mirror such as conda-forge:
conda install -c conda-forge 
  1. Improve network stability for large downloads:
conda config --set remote_read_timeout_secs 120

Full Example

Example scenario:

CondaVerificationError: The package 'numpy-1.23.5-py311...' appears to be corrupted. 
The expected MD5 sum does not match the actual file.

Fix:

conda clean --packages --tarballs --yes
conda install numpy

If this fails again, delete the corrupted cache entry:

rm -rf ~/.conda/pkgs/numpy-1.23.5-py311*
conda install numpy

After reinstalling, Conda verifies the checksum successfully and the environment works normally.

Pitfalls & Debug

  • Symptom: Verification fails again after reinstall → Fix: Run conda update conda to refresh metadata.
  • Symptom: Antivirus blocks files → Fix: Temporarily disable scanning during installation.
  • Symptom: Cache too large or fragmented → Fix: Use conda clean --all to reset all cached packages.
  • Symptom: “MD5 mismatch” error → Fix: Delete specific package folder from pkgs/ and reinstall.

Validation & Next Steps

After cleanup and reinstallation:

conda clean --all
conda list 

If the package appears in the list and no warnings occur during installation, integrity verification succeeded.

Sources

Anaconda Documentation — Managing packages
conda-forge community — best practices for checksum and cache management
Stack Overflow — user solutions for Conda verification errors
Python Packaging Authority — guidelines for package verification integrity

Labels: Tool/Conda, OS/Windows-macOS-Linux, Topic/Package-Corruption