本文介绍了在Anaconda python中手动删除pkgs文件夹中的所有文件是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了该命令以释放anaconda上的磁盘空间

I ran this command to release disk space on anaconda

$ conda clean -all

但是,anaconda python的 pkgs 文件夹中仍然有一些大文件.

However, there are still some big files that remain in pkgs folder in anaconda python.

手动删除 pkgs 文件夹中的所有文件是否安全?有损坏我的蟒蛇环境的风险吗?有什么副作用(如果有)?

Is it safe to manually delete all the files in pkgs folder? Any risk of corrupting my anaconda environment? What are some side effects, if any?

我正在Windows 10上使用anaconda 2018.

I am using anaconda 2018 on windows 10.

推荐答案

实际上,在某些情况下,可以选择除去 pkgs 子目录.如Anaconda社区支持在此处所述." pkgs 目录只是一个缓存.您可以将其完全删除.但是,在创建新环境时,将高速缓存中的所有程序包都留在周围效率更高."

Actually, under certain conditions it is an option to have the pkgs subdirs removed. As stated here by Anaconda Community Support "the pkgs directory is only a cache. You can remove it completely is you want to.However, when creating new environments, it is more efficient to leave whatever packages are in the cache around."

根据文档,您可以使用 conda clean --packages 删除 pkgs 中未使用的软件包(这会将它们移动到 pkgs/.trash 中,然后可以从中安全删除它们).虽然这不会检查使用返回到程序包缓存的符号链接安装的程序包,但是如果您不使用此类环境或在Windows下工作,则不是主题.我想这就是 conda clean --all 中包含 conda clean --packages 的原因.

According to the documentation you can use conda clean --packages to remove unused packages in pkgs (which will move them to pkgs/.trash from which you can then safely delete them). While this does not check for packages installed using symlinks back to the package cache, this is not a topic if you don't use such environments or work under Windows. I guess that's why conda clean --packages is included in conda clean --all.

要更积极地节省空间,可以使用 conda clean --force-pkgs-dirs 删除所有可写程序包缓存(但要注意的是可能存在环境)与这些目录相关联).如果您不使用环境或在Windows下使用Anaconda,则可能很安全.就我个人而言,我使用此选项没有问题.

To more aggressively save space you can use conda clean --force-pkgs-dirs to remove all writable package caches (with the same caveat that there could be environments linked to these dirs). If you don't use environments or use Anaconda under Windows, you're probably safe. Personally, I use this option without issues.

这篇关于在Anaconda python中手动删除pkgs文件夹中的所有文件是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 05:01