What is the pip cache on Mac, and is it safe to delete?
Yes, the pip cache is safe to delete. It holds downloaded and locally built Python packages, and removing it does not touch anything installed in your environments.
Where it is
~/Library/Caches/pipWhat it is
pip caches the files it downloads from the Python Package Index, and the wheels it builds from source, in ~/Library/Caches/pip. Installing the same package version again, for example in a new virtual environment, can then skip the download or the build.
The cache grows with every new version you install. Scientific and machine learning packages are large, so a few installs of those can account for most of it.
You can check the location and size on your Mac with pip cache dir and pip cache info.
How big it gets
Often hundreds of MB, and several GB if you install large machine learning packages.
How to clear it by hand
- Open Terminal. If you use virtual environments, any of them will do, since the cache is shared.
- Run the command below. It removes every file in pip's cache.
- If your system uses pip3 rather than pip, run pip3 cache purge.
pip cache purgeWhat happens afterwards
Installed packages and virtual environments keep working. Future installs download from the index again, and packages that have no prebuilt wheel are compiled again.
How Diskzy handles it
Diskzy lists the pip cache in the Clean up tab and ticks it, as it does the uv cache.
Related guides
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free