【Anaconda】Anaconda空间清理

Anaconda 环境安装包与Cache清理

当初给笔记本C盘只分配了100G的内存,用了好几年现在C盘可用空间越来越少了。之前装了不少anaconda的环境,想着释放一些无用的包可以达到释放空间的效果。

常用的命令

删除没有环境使用的所有的安装包及cache

# 全给我删了!也别再问我了!当然不会正在用的包删了:)
conda clean --all -y

# 把没用到的包删了哦~
conda clean -p

所有功能

想要使用某一个功能非常简单,把一个命令的功能摸透才有乐趣。

(condaenv) C:\Users\>conda clean -h
usage: conda-script.py clean [-h] [-a] [-i] [-p] [-t] [-f]
                             [-c TEMPFILES [TEMPFILES ...]] [-d] [--json] [-q]
                             [-v] [-y]

Remove unused packages and caches.

Options:

optional arguments:
  -h, --help            Show this help message and exit.

Removal Targets:
  -a, --all             Remove index cache, lock files, unused cache packages,
                        and tarballs.
  -i, --index-cache     Remove index cache.
  -p, --packages        Remove unused packages from writable package caches.
                        WARNING: This does not check for packages installed
                        using symlinks back to the package cache.
  -t, --tarballs        Remove cached package tarballs.
  -f, --force-pkgs-dirs
                        Remove *all* writable package caches. This option is
                        not included with the --all flag. WARNING: This will
                        break environments with packages installed using
                        symlinks back to the package cache.
  -c TEMPFILES [TEMPFILES ...], --tempfiles TEMPFILES [TEMPFILES ...]
                        Remove temporary files that could not be deleted
                        earlier due to being in-use. Argument is path(s) to
                        prefix(es) where files should be found and removed.

Output, Prompt, and Flow Control Options:
  -d, --dry-run         Only display what would have been done.
  --json                Report all output as json. Suitable for using conda
                        programmatically.
  -q, --quiet           Do not display progress bar.
  -v, --verbose         Can be used multiple times. Once for INFO, twice for
                        DEBUG, three times for TRACE.
  -y, --yes             Do not ask for confirmation.

英语解释一下看着有点费力,毕竟是中文blog。

conda clean 后面可以跟很多超参,不同超参有不同的功能:
可选参数:
-h -help		呼出帮助

选择要删除的目标:
  -a, --all					移除索引缓存,锁定文件,未使用的缓存包和tarball。
  -i, --index-cache			移除索引缓存
  -p, --packages        	从可写的包缓存中移除未使用的包
  -t, --tarballs			移除缓存的软件包tarball。.tar
  -f, --force-pkgs-dirs		(不推荐用)删除所有的可写程序包缓存。该选项不包括在--all标志中。 警告:这将破坏使用符号链接安装回软件包高速缓存安装软件包的环境。
  -c TEMPFILES [TEMPFILES ...], --tempfiles TEMPFILES [TEMPFILES ...]
 		删除由于正在使用而无法删除的临时文件。 参数是应在其中找到和删除文件的前缀的路径。

输出,提示和流控制:
  -d, --dry-run         仅显示要完成的操作
  --json                将所有输出报告为json。 适用于以编程方式使用conda。
  -q, --quiet           不要显示进度条,不要cmd里都是乱乱的log!
  -v, --verbose         可以多次使用。 用一次是INFO,用两次是DEBUG,用三次是TRACE。
  -y, --yes             老子就要删,别让我再确认了,麻烦。
  • 49
    点赞
  • 156
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值