Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to delete ~/.cache/pip directory

Tags:

pip

I have limited space on my server, and I am thinking to delete the cache of the PIP. I am not sure if its safe to delete or not.

ls  ~/.cache/pip/ 

Contains following dir/files.

http  selfcheck.json  wheels 

Version

$ pip -V pip 7.1.2 from /usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg (python 2.7) 

Please advise.

like image 817
A.J. Avatar asked May 29 '16 18:05

A.J.


People also ask

What is pip cache folder?

pip provides an on-by-default caching, designed to reduce the amount of time spent on duplicate downloads and builds.

Can I delete root cache pip HTTP?

cache directory, for example for pip to install desired version of package. Yes you can delete all of . cache with no long term detrimental effects.

What is -- no cache Dir in pip install?

Using --no-cache-dir flag in pip install ,make sure dowloaded packages by pip don't cached on system . This is a best practise which make sure to fetch ftom repo instead of using local cached one . Further , in case of Docker Containers , by restricing caching , we can reduce image size.

Can I delete cache folder Linux?

For the most part you can delete most anything in your home directory, programs or applications that require . cache (or other dot files such as . local ) will re-create them. Most of the time, at worst, you will lose custom configurations, but no real harm to the system.


1 Answers

Since pip 20.1b1, which was released on 21 April 2020 and "added pip cache command for inspecting/managing pip’s wheel cache", you no longer need to. Instead, you can issue this command:

pip cache purge 

The reference guide is here:
https://pip.pypa.io/en/stable/reference/pip_cache/
The corresponding pull request is here.

like image 148
Bence Mélykúti Avatar answered Sep 22 '22 02:09

Bence Mélykúti