简体   繁体   English

我可以使用口译员更新Conda环境吗

[英]Can I update a Conda environment with an interpreter

I created an environment with the following command without specifiying an interpreter: 我使用以下命令创建了一个环境,但未指定解释器:

conda create --name myenv

However, I should have created it with this 但是,我应该用它创建它

conda create -n myenv python=3.6 

Can I modify the environment to include the interpreter? 我可以修改环境以包括解释器吗?

Yes you can simply activate the environment (this is different depending on your version of conda and operating system) 是的,您只需激活环境即可(具体取决于您的conda版本和操作系统)

Since conda 4.4: 从conda 4.4开始:

conda activate myenv

Before conda 4.4: 在conda 4.4之前:

Windows: 视窗:

activate myenv

Linux/MacOS: Linux的/ MacOS的:

source activate myenv

Installing... 安装...

and then install any packages you need into it (conda treats python as a package) 然后将所需的任何软件包安装到其中(conda将python视为软件包)

conda install python=3.6

As mentioned in comments you can also install directly into the environment without activating: 如评论中所述,您也可以直接安装到环境中,而无需激活:

conda install -n myenv python=3.6

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

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