简体   繁体   English

conda可以从env environment.yml中自动激活环境吗?

[英]Can conda automatically activate the env from an env environment.yml?

This my environment.yml: 这是我的environment.yml:

name: my-env-name
dependencies:
  - blah

To create this env I can cd to the dir with the yml in it and do this: 要创建此环境,我可以将其中的yml CD到dir并执行以下操作:

conda env create

Conda's smart enough to look in the yml and see the env name. 康达(Conda)足够聪明,可以查看yml并看到env名称。

But to activate it why do I have to do this: 但是要激活它,为什么我必须这样做:

source activate my-env-name

Is there a switch to have conda just activate the env name from the environment.yml? 是否有一个开关可以让conda仅仅从environment.yml激活env名称?

It's impossible. 不可能。 Workaround: direnv with anaconda layout 解决方法: Direnv使用Anaconda 布局

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM