如何获取基本Conda安装目录(不是conda_prefix)?
我正在尝试找出获得基本Conda安装目录的最佳方法。
我写了这篇文章,但我知道这不是做到这一点的最佳方法:
(base) -bash-4.2$ which conda
/usr/local/devel/ANNOTATION/jespinoz/anaconda3/bin/conda
(base) -bash-4.2$ which conda | python -c "import sys; print('/'.join(sys.stdin.read().split('/')[:-2]))"
/usr/local/devel/ANNOTATION/jespinoz/anaconda3
我缺少一些环境变量吗?
I'm trying to figure out the best way to get the base conda installation directory.
I wrote this but I know this isn't the best way to do it:
(base) -bash-4.2$ which conda
/usr/local/devel/ANNOTATION/jespinoz/anaconda3/bin/conda
(base) -bash-4.2$ which conda | python -c "import sys; print('/'.join(sys.stdin.read().split('/')[:-2]))"
/usr/local/devel/ANNOTATION/jespinoz/anaconda3
Is there some environment variable I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个诀窍是回声
conda_prefix
来自激活的 base :也有
conda_root
,但是当没有激活环境激活的环境时,我认为这不是定义的。One trick is to echo
CONDA_PREFIX
from activated base:There is also
CONDA_ROOT
, but I don't think that is defined when no environment is activated.