pip cache on Mac (~/Library/Caches/pip): safe to delete?
Where it is
~/Library/Caches/pip~/.cache/pip
What it is
pip keeps two kinds of data in its cache: HTTP responses from package indexes, and wheels, including ones it built locally from source distributions. On macOS the default location is ~/Library/Caches/pip, while some setups point it at ~/.cache/pip instead.
Why it gets so big
The cache is shared by every virtualenv and Python version on your Mac, and it keeps old package versions indefinitely. Large scientific and machine learning wheels make it grow quickly.
Is it safe to delete?
Yes. Packages already installed in your environments are unaffected. The downside is that the next install re-downloads wheels and may have to rebuild packages that only ship as source, which can be slow. pip's own purge command clears it cleanly.
Tip
pip's cache info and cache list subcommands show what's in there and how big it is before you delete anything.
See how much space it uses
du -sh "$HOME/Library/Caches/pip" "$HOME/.cache/pip" 2>/dev/nullClean it with the tool’s own command
pip cache purgeDelete it by hand
Run in Terminal. Deleting cannot be undone, so check the paths first.
rm -rf "$HOME/Library/Caches/pip"/*
rm -rf "$HOME/.cache/pip"/*