Language toolchains & SDKs

Where Is the pip Cache on macOS, and Is It Safe to Delete in 2026?

If you have been developing Python on a Mac for any length of time, your pip cache location on macOS has quietly grown in the background — sometimes to several gigabytes — without you ever noticing it. This post pins down the exact path, explains what is actually stored there, and settles the question of whether deleting it will cause any lasting harm (it will not).

Where Is the pip Cache Stored on macOS?

pip follows the XDG Base Directory convention on macOS, which maps to Apple's standard user-cache location. For any pip version from pip 20 onward the cache lives at:

~/Library/Caches/pip

Expanded for a user named alex, that is:

/Users/alex/Library/Caches/pip

You can confirm the exact path pip is using at any time by running:

pip cache dir

This works whether you are using the system Python, a Homebrew Python, a pyenv shim, or a virtual-environment pip — the command always reports the active cache directory. If you have multiple Python installations managed by pyenv or conda, they all share the same ~/Library/Caches/pip folder by default, so the cache can accumulate from many projects at once.

What Is Inside ~/Library/Caches/pip?

Open the folder in Finder with open ~/Library/Caches/pip and you will find two main subdirectories:

  • wheels/ — Pre-built binary packages (.whl files) that pip compiled or downloaded. When you reinstall the same package version, pip reuses the wheel instead of downloading and compiling again, which can save minutes on packages like NumPy, Pandas, or Pillow.
  • http-v2/ (formerly http/) — Hashed HTTP responses from PyPI. pip stores the raw server responses here so it can skip network requests for packages it has already fetched recently.

Everything in this folder is derived data. pip generated it from public sources (PyPI or your private index) and can regenerate it on demand. No source code, no project configuration, no credentials live here.

How Much Space Does the pip Cache Use?

The size depends entirely on how many packages you have installed across all your environments. A modest data-science setup can accumulate 1–3 GB. A machine used for cross-platform CI testing or packaging can easily exceed 10 GB over several years.

Check the current size from Terminal:

du -sh ~/Library/Caches/pip

To see a breakdown by subdirectory:

du -sh ~/Library/Caches/pip/*

Is the pip Cache Safe to Delete?

Yes — deleting the pip cache is safe. The cache holds no original data; it is a performance optimisation only. The consequences of clearing it are:

  • The next pip install of any cached package will download from PyPI again instead of reading locally.
  • Packages that require compilation (C extensions, etc.) will compile again on first install after the cache is cleared.
  • Your installed Python environments are completely unaffected. Packages already installed in a venv or site-packages are not in the cache — they are separate.

If you use Crumb and want a second opinion before deleting, you can drop the folder path into the Ask Crumb command bar or trigger the "Is this safe to delete?" AI. It will examine ~/Library/Caches/pip, identify it as a regenerable pip cache, and flag it as low-risk — useful reassurance if you are new to Mac development and not yet certain which Library folders are safe to touch.

How to Clear the pip Cache

Option 1: pip cache purge (recommended)

pip has a built-in subcommand that safely removes all cached wheels and HTTP responses:

pip cache purge

pip will print a summary of what it removed. This is the cleanest method because pip manages the removal itself and updates any internal bookkeeping it maintains.

To remove only wheels for a specific package (without nuking everything):

pip cache remove numpy

To list what is cached before deciding:

pip cache list

Option 2: Delete the folder manually

You can delete the entire cache directory directly. pip will recreate it the next time it needs to cache something:

rm -rf ~/Library/Caches/pip

This is equivalent to pip cache purge but also removes any stale metadata pip might have left behind. Both approaches are safe.

Option 3: Disable caching for a single install

If you want pip to skip the cache for one command without deleting anything:

pip install --no-cache-dir some-package

When Should You Actually Clear the pip Cache?

You do not need to clear the pip cache on a schedule — it is not the kind of file that causes problems if left alone. Clear it when:

  • You need to reclaim disk space immediately (the cache is often one of the largest items under ~/Library/Caches/).
  • A package install is behaving strangely and you suspect a corrupted cached wheel.
  • You are decommissioning a development machine or handing it to someone else.
  • You have upgraded Python and want a clean slate for the new interpreter version.

pip Cache vs. Other Python Caches on macOS

Cache / folder Path Safe to delete? Effect of deleting
pip cache ~/Library/Caches/pip Yes Slower reinstalls, re-downloads
Homebrew cache ~/Library/Caches/Homebrew Yes Re-downloads on next brew install
pyenv shims ~/.pyenv/shims/ No — regenerate, don't delete Python commands break until you run pyenv rehash
Python __pycache__ Inside your project folders Yes Slower first import, no other effect
virtualenv / venv Wherever you created it Only if you no longer need it Removes the isolated environment

Automating pip Cache Cleanup

If you want to keep the cache from growing unbounded without manual intervention, you can configure pip to limit its maximum cache size. Add this to ~/.config/pip/pip.conf (create the file if it does not exist):

[global]
cache-dir = ~/Library/Caches/pip

pip does not enforce a size cap natively, but you can add a shell function to your ~/.zshrc that purges the cache whenever it exceeds a threshold:

# In ~/.zshrc
pip-cache-clean() {
  local size_mb
  size_mb=$(du -sm ~/Library/Caches/pip 2>/dev/null | awk '{print $1}')
  if [[ $size_mb -gt 2048 ]]; then
    echo "pip cache is ${size_mb}MB — purging"
    pip cache purge
  fi
}

Call pip-cache-clean from your terminal whenever you feel like it, or add it to a periodic script.

If you prefer a graphical approach, download Crumb and use the Visualize tab to see ~/Library/Caches/ as an interactive disk map. The pip folder will appear sized proportionally alongside your other caches, making it easy to spot when it has grown unusually large relative to everything else.

Summary

The pip cache on macOS lives at ~/Library/Caches/pip and contains only regenerable wheels and HTTP responses. It is entirely safe to delete at any time using pip cache purge — your installed packages, virtual environments, and source code are untouched. Clear it when you need the space or when debugging a broken install, and let pip rebuild it naturally as you work.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Where is the pip cache located on macOS?
The pip cache is stored at ~/Library/Caches/pip. You can confirm the exact path for your pip installation by running `pip cache dir` in Terminal.
Is it safe to delete the pip cache on macOS?
Yes. The pip cache contains only derived data — pre-built wheels and downloaded HTTP responses from PyPI. Deleting it does not affect your installed packages or virtual environments. pip will simply re-download what it needs on the next install.
How do I clear the pip cache on macOS?
Run `pip cache purge` in Terminal to remove all cached wheels and HTTP responses. You can also delete the folder directly with `rm -rf ~/Library/Caches/pip`, or remove a specific package's cache with `pip cache remove <package-name>`.
Will clearing the pip cache break my Python environments?
No. Packages already installed in a virtual environment or site-packages are stored separately, not in the cache. Clearing the cache only means pip will download packages again on the next install instead of using a local copy.
How much space does the pip cache take on macOS?
It varies by usage, but a typical development machine can accumulate 1–5 GB over time. Run `du -sh ~/Library/Caches/pip` to see the current size on your system.