1. Make sure you are asking the right pip
Many Macs have more than one Python: the one that comes with Apple’s command line tools, one from Homebrew, others from pyenv or conda. Running pip as python3 -m pip makes the command use the interpreter you expect, and python3 -m pip --version prints which one that is. which -a python3 lists every python3 on your PATH, in the order your shell finds them.
By default they all share one per-user cache folder, so clearing it once clears it for every Python on the Mac. If pip cache dir prints something unexpected, a setting or environment variable has moved it; measure that path instead.
python3 -m pip --version
python3 -m pip cache dir2. Measure the cache
pip’s documentation gives ~/Library/Caches/pip as the default location on macOS. pip cache info reports the size of its two parts: the HTTP cache, which stores downloaded responses so pip does not fetch the same files again, and the wheel cache, which stores wheels pip built locally from source packages.
du gives the same total from outside pip. Because the folder sits in ~/Library/Caches, Storage settings counts it with other app caches, usually inside System Data, not under a Python or Developer heading.
python3 -m pip cache info
du -sh ~/Library/Caches/pip3. Clear it with pip’s own command
pip cache purge removes everything in the cache. For something narrower, pip cache list shows the locally built wheels and pip cache remove with a package name removes the matching ones. Nothing installed is affected; the next install downloads packages again, and anything built from source takes longer the first time.
pip also accepts --no-cache-dir to skip the cache entirely, but its documentation recommends not disabling caching unless you have caching at a higher level. On a laptop, an occasional purge is the better trade.
python3 -m pip cache list
python3 -m pip cache remove numpy
python3 -m pip cache purge4. Find virtual environments
Each virtual environment holds its own full copy of the packages installed into it, so ten projects with the same data-science stack store it ten times. They usually sit in a .venv or venv folder inside each project. The command below lists every .venv under a projects folder with its size; adjust the path, and repeat with venv if you use that name.
Python’s documentation describes a virtual environment as disposable: it should be simple to delete and recreate from scratch, it is not meant to be moved or copied, and it is not checked into source control. That makes environments of old projects some of the safest large folders on a developer Mac.
find ~/Projects -type d -name .venv -prune -exec du -sh {} + 2>/dev/null | sort -h5. Remove an environment you can rebuild
If the project has no requirements file or lock file, activate the environment and save its package list first with pip freeze. Then run deactivate, close any editor using that environment, and move the .venv folder to the Trash.
To rebuild it later, create a new environment in the project and install from the saved list. Tools such as Poetry or Pipenv manage their environments elsewhere and have their own remove commands, so use theirs rather than deleting folders they track.
python -m pip freeze > requirements.txt
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txtuv and conda keep separate caches
If you install packages with uv, its cache is separate from pip’s: $HOME/.cache/uv on a Mac unless configured otherwise. uv cache prune removes unused entries and uv cache clean removes everything. ClearDisk’s Developer Junk list includes ~/.cache as tool caches, so uv’s folder shows up there with a size; the package manager’s own command is still the tidier way to shrink it.
conda has its own package cache and environments, covered in the conda guide. Moving any of these folders to the Trash frees space only once the Trash is emptied.
uv cache dir
uv cache prunepip --no-cache-dir: what the flag switches off
pip keeps two caches, both in ~/Library/Caches/pip on a Mac. The HTTP cache works like a browser cache for files pip downloads from a package index, and pip still checks with the server when an entry has expired. The wheel cache stores wheels pip built itself from source packages, so the next install of the same version skips the build.
--no-cache-dir turns both off for that one command. pip downloads every file again, builds any source package again, and saves nothing afterwards. Your existing cache is not touched, and the next ordinary pip command uses it as before. pip’s documentation advises against disabling the cache unless something at a higher level caches for you, such as layered container builds.
python3 -m pip cache dir
python3 -m pip cache info
python3 -m pip install --no-cache-dir requestsWhen to use --no-cache-dir
In a Dockerfile, a pip cache written during RUN pip install ends up inside that image layer, where it adds size to every copy of the image and is never used again. Adding --no-cache-dir to that command, or ENV PIP_NO_CACHE_DIR=1 near the top of the Dockerfile, keeps it out. Inside a Linux container the cache path is ~/.cache/pip, usually /root/.cache/pip, not the Mac path.
If rebuilds are slow because every build downloads the same wheels, Docker’s documentation shows a cache mount instead: RUN --mount=type=cache,target=/root/.cache/pip in front of pip install -r requirements.txt. The cache then stays in Docker’s build cache rather than in the image, and survives between builds. On a Mac that build cache lives inside Docker Desktop’s disk image, which the Docker build cache guide explains how to measure and prune. A CI runner that starts empty on every job gains nothing from pip’s cache either.
Common questions
Where does pip store its cache on a Mac?
By default it is ~/Library/Caches/pip; pip cache dir confirms the exact path. Because it sits in ~/Library/Caches, Storage settings counts it with other app caches rather than under a Python-specific heading.
Is it safe to delete a Python virtual environment folder?
Yes. Python's own documentation describes a virtual environment as disposable and meant to be deleted and recreated from scratch. Save the package list with pip freeze first if the project has no requirements file.
Will clearing the pip cache break my installed packages?
No. pip cache purge only removes cached downloads, so nothing already installed is affected. The next install just downloads packages again, and anything built from source takes a little longer the first time.
Does clearing pip's cache also clear conda's or uv's cache?
No, each tool keeps its own. uv's cache lives separately at ~/.cache/uv and is cleared with uv cache prune or uv cache clean, while conda has its own package cache covered by conda's own commands.
When should I use pip's --no-cache-dir flag?
It's most useful in a Dockerfile, since a pip cache written during a build gets baked into that image layer and is never reused, and for ruling out a stale cached build by forcing a fresh download.
Does --no-cache-dir delete pip's existing cache?
No, it only skips the cache for that one command: nothing is read from it and nothing is saved to it, while the existing cache on disk is left untouched for the next ordinary pip command.
References & further reading
These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.