新创建的 conda envs 是否从基本 env 继承所有包? [英] Do newly created conda envs inherit all packages from the base env?

查看:65
本文介绍了新创建的 conda envs 是否从基本 env 继承所有包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Anaconda 并创建了一个新的环境(dell_proj").然后我用我的新环境在 Pycharm 中创建了一个新项目.我的期望是,我只能在该项目中使用通过 Conda 在该特定环境中安装的包,但是,我能够使用在 Base 环境中安装的所有包.

I installed Anaconda and created a new env ("dell_proj"). Then I created a new Project in Pycharm with my new environment. My expectation was that I would only be able to use packages in this project that I installed through Conda in that specific env, however, I am able to use all packages that were installed in the Base environment.

Conda for env 中显示的包

Pycharm for env 中显示的包

有人能解释一下我在这里的误解吗?

Could somebody explain what I'm misunderstanding here?

推荐答案

您可以使用创建基础环境的克隆conda create --name dell_proj --clone base.这将创建一个作为基础环境副本的新环境.

You can create a clone of the base environment using conda create --name dell_proj --clone base. This will create a new environment that is a copy of your base environment.

如果您使用 conda create --name dell_proj 之类的东西创建了新环境,它将不会从基础环境继承包.您必须使用 conda install 安装所需的软件包.

If you created the new environment using something like conda create --name dell_proj, it will not inherit packages from the base environment. You would have to install the packages you want using conda install.

这篇关于新创建的 conda envs 是否从基本 env 继承所有包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆