Finding the active pip cache location helps explain why repeated installs are reusing old downloads, why disk usage is growing inside a user profile, or why one interpreter is seeing cached artifacts that another interpreter is not.
The pip cache keeps two different data sets under the cache root used by the current interpreter or virtual environment: HTTP responses from package indexes and locally built wheels. python3 -m pip cache dir shows the root path, while python3 -m pip cache info breaks out the live HTTP and wheel cache locations and python3 -m pip cache list shows cached wheel files without manually browsing the filesystem.
The cache directory is not fixed across every environment. Current upstream pip documentation treats the cache layout as an implementation detail, newer releases store HTTP responses under http-v2 instead of the older http path, and overrides such as PIP_CACHE_DIR, XDG_CACHE_HOME, or --cache-dir can move the cache entirely. Running the cache commands through python3 -m pip keeps the result tied to the active interpreter context, while Windows systems normally use py -m pip. The sample path and wheel names below are masked examples that preserve the current output shape.
Related: How to clear the pip cache
Steps to show the pip cache location:
- Show the active cache directory used by the current pip context.
$ python3 -m pip cache dir /Users/alex/Library/Caches/pip
Default cache roots are typically ~/Library/Caches/pip on macOS, ~/.cache/pip on Linux, and %LocalAppData%\pip\Cache on Windows unless pip is overridden. On Windows, run py -m pip cache dir.
- Review the cache summary to identify the current HTTP cache path, wheel cache path, and the size of each area.
$ python3 -m pip cache info Package index page cache location (pip v23.3+): /Users/alex/Library/Caches/pip/http-v2 Package index page cache location (older pips): /Users/alex/Library/Caches/pip/http Package index page cache size: 684 kB Number of HTTP files: 11 Locally built wheels location: /Users/alex/Library/Caches/pip/wheels Locally built wheels size: 143 kB Number of locally built wheels: 4
pip currently stores newer HTTP responses under http-v2. An older http directory can still appear after upgrading from earlier pip releases.
- List cached wheel files with absolute paths when the exact on-disk wheel location is needed.
$ python3 -m pip cache list --format=abspath /Users/alex/Library/Caches/pip/wheels/18/4d/9a/bcf4d73a2be41b13d693ac7a37ab3be2d243c287ae03e06b9f/auditrelay-2.4.1-py3-none-any.whl /Users/alex/Library/Caches/pip/wheels/4b/0e/52/cd21f90b678bfe6d89bb1e259398d8a8d48f53f0b595fb1943/edgepolicy-1.8.0-py3-none-any.whl /Users/alex/Library/Caches/pip/wheels/8f/c7/14/41f27e6b2f3fd4c8b0e2d39c1d9d8c0d2bc7a9c0af87e58cf1/inventorysync-0.9.2-py3-none-any.whl /Users/alex/Library/Caches/pip/wheels/f1/23/6c/8dfad645e96796b0eeb0b0b40281b03a9257d3675f9f1b72aa/reportparser-1.5.0-py3-none-any.whl
pip cache list reports cached wheel files only. Use pip cache info when the HTTP cache location or total cache size is the detail that matters.
- Filter the wheel cache by package name or glob pattern when only one cached build matters.
$ python3 -m pip cache list auditrelay Cache contents: - auditrelay-2.4.1-py3-none-any.whl (13 kB)
The list subcommand accepts either a package name or a glob expression. A short result, or No locally built wheels cached., is normal in fresh environments.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
