WindowsmacOSLinux

Where Is the pip Cache Located?

The pip wheel and download cache on Windows, macOS and Linux, the command that prints it, and how to tell it apart from site-packages.

Last updated

pip keeps a cache of downloaded packages and built wheels so repeat installs are quick. It is not where your installed packages end up, and mixing the two up is the usual reason someone worries about deleting it.

Ask pip rather than guess: pip cache dir prints the folder pip is really using, pip config list shows any override in effect, and pip cache purge empties it. The default differs per OS, and XDG_CACHE_HOME or PIP_CACHE_DIR can move it anywhere. On a machine where the path looks wrong, those two commands settle it in a second.

Where pip stores this, by platform

Windows
%LocalAppData%\pip\Cache

The pip docs spell it with a capital C: C:\Users\[Username]\AppData\Local\pip\Cache. Inside it, an http or http-v2 folder holds downloaded index pages and wheels, and a wheels folder holds wheels pip built locally. pip cache dir prints whatever pip is really using, including after --cache-dir or PIP_CACHE_DIR.

macOS
~/Library/Caches/pip

macOS does not follow the Linux default; pip uses the standard Library/Caches location instead of ~/.cache/pip. Since pip 26.2 it also honours XDG_CACHE_HOME, so a custom setting can move it back. python -m pip cache dir is the honest answer on your own machine.

Linux
~/.cache/pip

The XDG default, so it becomes $XDG_CACHE_HOME/pip if you have that set. Subfolders are http-v2 for index and wheel downloads, plus wheels for anything pip built itself. python3 -m pip cache info reports the two sizes separately.

Frequently asked questions

is it safe to delete the pip cache

Yes. pip cache purge only throws away downloads and wheels pip can re-fetch or rebuild, so your next install is simply slower. Installed packages are untouched, because they live in site-packages rather than in the cache folder.

difference between pip cache and site packages

The cache holds installers, site-packages holds the installed code. Run python -m site to see where site-packages is, and pip show requests to see what is installed there. Emptying the cache changes neither.

how do i find my pip cache folder

Run pip cache dir, or python -m pip cache dir if pip is not on your PATH. It prints %LocalAppData%\pip\Cache on Windows, ~/Library/Caches/pip on macOS and ~/.cache/pip on Linux, unless an environment variable moved it.

Notice an outdated path? Let us know.