简体   繁体   English

将anaconda与多个conda环境一起使用

[英]Using anaconda with multiple conda env

I have to create conda env anytime creating a new project. 我必须在创建新项目时随时创建conda env recently i find out anaconda create every single package in its environment even it exist in base anacoda package .so in this situation is it rational using anacoda ? 最近我发现anaconda在其环境中甚至在基本的anacoda软件包中都创建了每个单独的软件包。所以在这种情况下,使用anacoda是否合理?

You are doing great by creating separate environment for each of your projects. 通过为每个项目创建单独的环境,您会做得很好。 The aim of environments is to keep your projects dependencies separate. 环境的目的是使项目依赖项保持独立。 This means, your project will have only necessary packages. 这意味着您的项目将仅具有必要的软件包。

The problem of using a single environment is that if you update some packages, you are most likely going to destroy something. 使用单个环境的问题是,如果更新某些软件包,则很可能会破坏某些内容。 Example, if you have a project that works only in PACKAGE 1.0, install a package that would update your PACKAGE 1.0 is going to break all your scripts that depends on it. 例如,如果您有一个仅适用于PACKAGE 1.0的项目,则安装一个将更新PACKAGE 1.0的程序包将破坏所有依赖于该程序包的脚本。 The large the environment, the more likely you would break some dependence. 环境越大,您越有可能打破某种依赖性。 By having separate environments, you are sure that your scripts would always run :) 通过使用单独的环境,可以确保脚本将始终运行:)

Another beautiful thing is that of reproducibility. 另一个美丽的东西是可复制性。 You can save your dependence with there right Python versions. 您可以使用正确的Python版本保存您的依赖关系。

Update: A simple answer 更新:一个简单的答案

No, you don't have too create environment for each project. 不,您没有为每个项目都创建环境。 It is a good practice but not a must. 这是一个好习惯,但不是必须的。 If the project uses the same packages, then reusing environments is a smart move. 如果项目使用相同的软件包,则重用环境是明智之举。 But the moment there exists differences in used packages, then I would recommend separate environments. 但是,当所使用的软件包存在差异时,我将建议使用单独的环境。

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

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