The location of the pip cache directory

pip uses a cache to avoid downloading packages again:

% pip install lxml  
Collecting lxml
  Using cached lxml-4.9.2-cp311-cp311-macosx_13_0_arm64.whl
Installing collected packages: lxml
Successfully installed lxml-4.9.2

The pip cache dir command can be used to find the location of that cache on your system:

% pip cache dir

Wheels are cached in pip/wheels - in a nested set of folders based on a hash, for example:


I found this pattern worked for deleting files from the cache:

cd $(pip cache dir)
find wheels | grep lxml | xargs rm


Created 2023-04-28T11:58:14-07:00 · Edit