Where does conda clean remove packages from?

北战南征 提交于 2020-08-22 08:09:16

问题


The conda documentation specifies:

conda clean [-h] [-y] [--dry-run] [--json] [--debug] [--verbose] [-q] [-a] [-i] [-l] [-t] [-p] [-s]

Remove unused packages and caches.

Example:

conda clean --tarballs

(conda clean documentation)

So it is supose to remove unused packages.

where from ?

  • from conda (base) ?
  • from the active environment ?

Does the environment need to be active?

How does it know they are unused packages?


回答1:


It removes unused packages from under the pkgs/ directory wherever you happen to have conda installed. An "unused" package is one that's not used in any environment. All conda packages are stored under the pkgs/ directory and then hard-linked (if possible) into the environments.

As an aside, conda clean will print out the location of where the packages are actually located:

$ conda clean -all
Cache location: /data/processing/ryan/miniconda/pkgs
Will remove the following tarballs:

/data/processing/ryan/miniconda/pkgs
------------------------------------
filelock-3.0.10-py_0.tar.bz2                   9 KB

Edit 13.3.2020 rvf pointed out that the -all option has been changed to -a or --all in conda 4.8.2.



来源:https://stackoverflow.com/questions/51960539/where-does-conda-clean-remove-packages-from

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!