gpt4 book ai didi

python-3.x - ~/.conda/envs 与 ~/anaconda3/envs

转载 作者:行者123 更新时间:2023-12-04 01:13:08 24 4
gpt4 key购买 nike

我最近在更新 macOS Catalina 后调试了 Anaconda 的一些问题,并注意到配置中添加了 ~/.conda/envs。这已经破坏了我的许多开发环境,我想知道......

为什么我会看到 conda 环境的这个新位置?我可以将其删除并继续仅在 ~/anaconda3/envs 中使用和创建环境吗?

conda info
...
envs directories : /Users/me/.conda/envs
/Users/me/anaconda3/envs
...

最佳答案

根据 this GitHub issue~/.conda/envs的目的是为conda提供至少一个保证用户可写的目录。

The ~/.conda directory is no longer used on Windows, only unix. Conda's install location is not guaranteed to be user-writable. Conda always needs at least one user-writable location for the package cache (pkgs directory) and the envs directory where new named environments are created. The default location for these directories is ~/.conda on unix, and on Windows we use appdirs. The ~/.conda directory has been used for years on unix for this purpose.

When conda's install location is user-writable, then that's the location chosen as "first writable" for these two directories. When conda's install location is not writable by the current user, then conda uses the ~/.conda directory as the writable location, but is still able to use the install location for a read-only package cache and named environments. Compare output of conda config --show for the two different cases.

The locations of these directories can be overrode by configuration using the envs_dirs and pkgs_dirs configuration parameters, or CONDA_ENVS_DIRS and CONDA_PKGS_DIRS environment variables.

只将环境安装到 ~/anaconda3/envs 应该是安全的,只要当前用户可写即可。例如,我只将环境安装到 ~/miniconda3/envs 并且没有遇到任何问题。

关于python-3.x - ~/.conda/envs 与 ~/anaconda3/envs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64216140/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com