How To Clear Pip Cache
Before cleaning the Pip Cache, you should know the size of the Pip cache in your system. Run the following command to see the size of Pip cache in your Linux.
pip cache info
If you want to see the size of the individual packages then run the following command:
pip cache list
Meanwhile, if you want more details like directory where the cache resides then run the following command:
pip cache dir
How To Clear Pip Cache
Now, let’s get into the real business. Let’s have a look into the process to clear Pip Cache.
if you want to remove a specific package from the cache, you can append the package name:
pip cache remove [package_name_to_remove]
Run the following command if you want to remove every package from the cache:
pip cache remove *
Remove every package from the Pip cache
Run the following command to use the purge with the pip cache:
pip cache purge
How to remove the pip cache manually
Run the following command to remove pip cache manually.
sudo rm -r ~/.cache/pip
sudo rm -rf /root/.cache/pip