時々わからなくなるので、メモということで。それなりにサイズも大きくなりますしね。
pipのドキュメントとしては、こちらを見ます。
Caching - pip documentation v24.1.dev0
pipのキャッシュが保存されるディレクトリは、以下に記載されています。
Caching / Where is the cache stored
各OSのデフォルトは以下のようです。
pip cache dir
コマンドでも取得することができます。
$ pip3 cache dir $HOME/.cache/pip
なお、この情報については実装の詳細にあたるので、pipの将来のバージョンで変更される可能性があるという注意があります。
The exact filesystem structure of pip’s cache’s contents is considered to be an implementation detail and may change between any two versions of pip.
確認したバージョン。
$ python3 --version Python 3.10.12 $ pip3 --version pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)