The pip cache is the folder where pip stores downloaded packages, locally built wheels and HTTP responses so repeat installs are fast. It is safe to clear. Run pip cache purge and pip downloads packages again the next time you install them. Installed packages in your environments are not affected.
- Path
~/Library/Caches/pip- What it is
- pip's cache of downloaded files and locally built wheels
- Typical size
- Hundreds of megabytes to several gigabytes; machine-learning wheels are large
- Made by
- pip (Python)
- Safe to delete?
- Safe to clear
- Comes back?
- Yes, pip downloads or rebuilds packages on the next install
What is in this folder?
On macOS pip uses ~/Library/Caches/pip, according to the pip documentation. It has a wheel cache for built packages and an HTTP cache for downloads. Compiling a package from source can take minutes, and the cache lets pip reuse the result.
The pip documentation also notes that the exact file structure is an implementation detail that can change between versions.
Is it safe to delete?
Yes. The cache only speeds up installs. Packages already installed in a virtual environment or in site-packages stay put. The cost is time: packages with a long compile step, such as ones with C extensions, take longer on the next install.
How do I clear it by hand?
- Close any running
pip install. - Check the size, then purge.
- Reinstall packages normally when you need them.
python3 -m pip cache info
python3 -m pip cache purgepip cache remove <package>removes one package's wheels, andpip install --no-cache-dirskips the cache for one install.
How do I stop it growing?
Run pip cache purge now and then, or install with --no-cache-dir in disposable environments.
How Clean House handles it
Clean House recognizes the pip cache as downloaded Python packages made by pip, and marks it as something that comes back. It leaves the cache alone while a pip install is running, and the files go to the Trash before they are gone for good.