Developers · Python
How to clear the pip cache on a Mac
Run python3 -m pip cache purge in Terminal. On a Mac, pip keeps its cache in ~/Library/Caches/pip, and purge clears both parts of it: the HTTP cache of what pip downloaded, and the wheels it has built or downloaded. It is safe. Packages you have installed are not in the cache; the next install just downloads, or builds, what it needs again.
Where pip keeps its cache
On a Mac the default is ~/Library/Caches/pip, in your hidden Library folder. To check where the pip you use is looking:
python3 -m pip cache dirpython3 -m pip runs the pip that belongs to that python3, which matters on a Mac with more than one Python. To see how big the cache is and what is in it:
python3 -m pip cache infopip's documentation describes two parts:
- The HTTP cache, which works like a web browser's cache: the files pip downloaded from the package index.
- The wheel cache: built packages pip reuses whenever it can, including ones it had to build from source.
Is it safe to delete?
Yes. The cache only saves pip from downloading or building something again. What you have installed lives somewhere else: in each virtual environment, or in the Python installation itself. Clearing the cache breaks no project. The cost is that the next install of each package is slower, needs a network connection, and rebuilds any package that has no ready-made wheel for your Mac.
Clear it
Everything at once:
python3 -m pip cache purgeOr just one package's wheels, by name or pattern. This leaves the HTTP cache as it is, so it frees less:
python3 -m pip cache remove numpyTo install something without adding to the cache at all, which suits a one-off install of a large package:
python3 -m pip install --no-cache-dir requestsWhat clearing it doesn't free
- Virtual environments. A
.venvin each project holds its own installed copies of every package, and is often bigger than the cache. Delete one only if the project can rebuild it, from arequirements.txtorpyproject.toml. - Packages installed with
pip install --user, in~/Library/Python. Scripts you run may need them. - uv's cache. uv keeps its own, which pip's commands don't touch. On a Mac it is usually
~/.cache/uv. To find yours and remove only what nothing uses:
uv's documentation callsuv cache dir uv cache pruneprunesafe to run periodically;uv cache cleanremoves everything.
Where the app comes in
RefreshYourMac has no pip category of its own: pip's cache is one of the folders in Application Caches, which lists each folder in ~/Library/Caches with its size and is rated Safe for auto removal. That is in both editions; the Mac App Store one sees it once you allow it your Caches folder. The download edition also measures ~/.cache, where uv's cache usually is, as Command-Line Tool Cache; packages installed with --user as Python User Packages, rated Review before deleting and moved to the Trash rather than deleted; and a project's .venv under Project Build Folders, only when the project has a requirements.txt or pyproject.toml to rebuild it from. For the rest, see the Mac cleaner for developers and how to clear the cache on a Mac.
What to do next: see these numbers for your own Mac. Download RefreshYourMac free, or get it on the Mac App Store.
What it costs to have an app do this
| RefreshYourMac | CleanMyMac | MacKeeper | |
|---|---|---|---|
| Pay once | $24.99 | €119.95 on MacPaw’s store; $89.99 for CleanMyMac X on the Mac App Store | subscription only |
| Yearly | $14.99 a year, first 7 days free | $39.99/yr on the Mac App Store; €39.95/yr on MacPaw’s store | €71.40 for the first year, 1 Mac. Their page shows it against a €119.40 list price |
| Monthly | $1.99 a month | $9.99/mo | €10.95/mo |
| Account needed | No | Yes | Yes |
Before you pay anything, both versions give you 3 free scans. CleanMyMac and MacKeeper prices read from their own pages and the Mac App Store on 27 October 2026; the full comparison is at RefreshYourMac vs CleanMyMac and MacKeeper.
Frequently asked questions
Where is the pip cache on a Mac?
By default in ~/Library/Caches/pip. Run python3 -m pip cache dir to see where the pip you use is looking, and python3 -m pip cache info to see how big it is.
Is it safe to delete the pip cache?
Yes. Installed packages live in each virtual environment or in the Python installation, not in the cache, so clearing it breaks no project. The next install of each package is slower and needs a network connection.
Does pip cache purge clear the uv cache too?
No. uv keeps a cache of its own, usually ~/.cache/uv on a Mac. uv cache prune removes what nothing uses, and uv cache clean removes everything.