删除〜/.cache/pip目录是否安全? [英] Is it safe to delete ~/.cache/pip directory
问题描述
我的服务器空间有限,我正在考虑删除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/
包含以下目录/文件.
http selfcheck.json wheels
版本
$ pip -V
pip 7.1.2 from /usr/local/lib/python2.7/dist-packages/pip-7.1.2-py2.7.egg (python 2.7)
请告知.
推荐答案
根据 pip的缓存文档,您可以使用-no-cache-dir 选项.
According to pip's caching documentation from version 6 you can use the --no-cache-dir option.
但是,这对我没有帮助,因为我正在使用在后台运行pip的包装器(pinax入门项目)来安装多个软件包.由于我一直收到pip.exceptions.HashErrors('哈希与需求文件不匹配),并且我不想修改其代码,因此我重命名了pip缓存文件夹并尝试再次运行包装器.一旦发现没有问题,我便继续删除整个缓存pip文件夹.在那之后我没有任何问题.因此,我可以假定删除pip的缓存文件夹完全是安全的操作.
But that didn't help me as I was using a wrapper (pinax starter projects) that runs pip in the background to install several packages. Since I kept getting an pip.exceptions.HashErrors ('hashes don't match the requirement file) and I didn't want to temper with its code I renamed the pip cache folder and tried running my wrapper again. Once I noticed there weren't issues I proceeded to delete the entire cache pip folder. I haven't had any problem after that. So I can assume it is entirely a safe operation to delete pip's cache folder.
以下是您可以找到点子缓存的位置:
These are the locations where you can find your pip cache:
Unix
〜/.cache/pip,它尊重XDG_CACHE_HOME目录.
~/.cache/pip and it respects the XDG_CACHE_HOME directory.
OS X
〜/Library/Caches/pip.
~/Library/Caches/pip.
Windows
\ pip \ Cache
\pip\Cache
这篇关于删除〜/.cache/pip目录是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!