PIP - Display pip cache using the pip cache command
by
Jeremy Canfield |
Updated: October 28 2023
| PIP articles
The pip cache dir command can be used to return the directory where pip will store cached files.
~]# pip cache dir
/root/.cache/pip
It's important to recognize that the pip command will be associated with a particular version of Python, which can be seen with the pip --version command. In this example, pip is part of Python version 3.9.6.
~]$ pip --version
pip 23.3.1 from /usr/local/bin/python3.9.6/lib/python3.9/site-packages/pip (python 3.9)
The following can be used if you want to list the directory where pip will store cached files in a specific version of Python.
~]$ /usr/bin/python3.6 -m pip cache dir
/root/.cache/pip
The pip cache list command can be used to display the cache.
~]$ pip cache list
Nothing cached.
The pip cache purge command can be used to remove the files in the cache directory.
pip3 cache purge
Something like this should be returned.
Files removed: 2
Did you find this article helpful?
If so, consider buying me a coffee over at