conda-env列表/conda信息--envs如何查找环境? [英] How does conda-env list / conda info --envs find environments?
问题描述
我一直在试验anaconda/miniconda,因为我的用户使用随miniconda安装的结构生物学程序,而作者A)都没有考虑到可能还有其他miniconda应用程序B)他们的程序将在多种环境中使用用户环境.
I've been experimenting with anaconda/miniconda because my users use structural biology programs installed with miniconda and none of the authors A) take into account that there might be other miniconda applications B) that their programs will be used in a multi-user environment.
因此,使用Arch Linux,我首先安装了anaconda(版本4.5.12),然后使用自己的帐户创建了两个测试环境:
So, using Arch linux, first I installed anaconda (version 4.5.12) , and then using my own account, created a couple of test environments:
conda create -n snakes
conda create -n sharks
然后,我(完全)卸载了anaconda并安装了miniconda(也是4.5.12版),然后在非标准位置以root用户身份创建了另一个环境:
I then (completely) uninstalled anaconda and installed miniconda (also version 4.5.12) and then created another environment in a non-standard location as root:
# conda create -p /usr/local/miniconda/pyem
在这里事情变得很奇怪.当我以root用户身份列出环境时,不仅会看到默认环境和我刚刚创建的环境,而且还会看到我以前使用我的用户帐户创建的那些环境!
Here's where things get weird. When I list the environments as the root user, I see not only the default and the one I just created, but also the ones I created previously using my user account!
[root@lizard /]# conda info --envs
# conda environments:
#
/home/cnsit/.conda/envs/sharks
/home/cnsit/.conda/envs/snakes
base * /opt/miniconda3
/usr/local/miniconda/pyem
(conda-env list
命令给出相同的输出.)
(The conda-env list
command gives the same output.)
所以,问题是:如何在conda上查找由其他用户创建的环境?此外,当conda原始实例的整个父目录已被删除并在一个完全不同的位置替换为一个目录时, (因此,本地 environments.txt 文件都无法对此进行分类.
So, question: how is conda finding environments created by a different user? Moreover, when the entire parent directory of the original instance of conda has been removed and replaced by one in an entirely different location (so no local environments.txt file could be cataloging this.
推荐答案
info
命令包含在 cli.main_info
模块,此案例的相关代码为此处导入该函数(除其他事项外)读取配置值envs_dirs
.您可以通过运行
The code for the info
command is contained in the cli.main_info
module, and the relevant code for this case is here. This imports the function from over here that (among other things) reads the configuration value envs_dirs
. You can find out the value of this configuration value on your system by running
conda config --show envs_dirs
我希望这会向您显示正在搜索的环境的用户目录.
I expect this will show you the user directories for environments as being searched.
这篇关于conda-env列表/conda信息--envs如何查找环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!