栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

【Anaconda】清理 conda 缓存后释放了几十 GB 空间

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【Anaconda】清理 conda 缓存后释放了几十 GB 空间

文章目录
  • 问题背景
  • 清理命令
    • 命令参数
    • 稳妥的清理命令

问题背景

之前虚拟环境的默认目录设置在 /home/ 下,导致 /home/ 目录不堪重负,在修改了虚拟环境的默认路径之后,发现包环境目录下存在很多文件夹和解压之前的压缩包,占用了极大的空间,既然叫缓存目录,我便到网上了解了一下该目录能否删除。

清理命令 命令参数
conda clean -h
xxx@xxx-Desktop:~$ conda clean -h
usage: conda 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.

Examples:

    conda clean --tarballs
稳妥的清理命令
  • conda clean -p :从可写包缓存中删除未使用的包。警告:这不会检查已安装的软件包使用符号链接返回包缓存。
  • conda clean -t:删除缓存的包 tarball。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/849191.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号