“基础"的目的是什么? (有关最佳做法)在Anaconda中? [英] What's the purpose of the "base" (for best practices) in Anaconda?

查看:81
本文介绍了“基础"的目的是什么? (有关最佳做法)在Anaconda中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它说这是默认环境,但是不过,您不想将程序放到基本环境中".

It says it's a default environment but "You don't want to put programs into your base environment, though"

那么我到底应该用它做什么呢?我创建的其他环境是从基础继承吗?

So what exactly should I use it for? Do other environments I create inherit from the base?

推荐答案

基本环境是conda本身的安装位置.最好使用Miniconda,并将 all 所需的东西安装到单独的环境中.

The base environment is where conda itself gets installed. It's best to use Miniconda, and install all the things you want into separate environments.

其他环境不会从基本环境继承程序包.但是基本环境的bin/目录位于可执行文件的搜索路径中.因此,如果您在任何环境(通常未安装conda)中调用conda,则将使用基本环境中的一个.

Other environments do not inherit packages from the base environment. BUT the bin/ directory of the base environment is in the search path for executables. So if you call conda from inside any of your environments (which usually don't have conda installed), the one from the base environment is used.

如果将其他可执行文件安装到基本环境中,则可以从其他环境中调用它们.但是,要区分可调用的对象是在您的环境中还是在基本环境中,您将度过一个艰难的时期.
因此,最好在基本环境中仅包含conda.如果您使用conda安装这种工具,也许还有其他通用工具,例如gitmake.但是,无论您使用Python/R/任何代码导入的包都不属于基本环境.

If you install other executables into the base environment, they can be called from your other environments. But you'll have a hell of a tough time to distinguish whether the things you can call are actually in your environment, or in the base environment.
Therefore, it's best to just have conda in the base environment. And maybe other generic tools, like git or make, if you install that kind of tool with conda. But packages that are imported by your Python/R/whatever code do not belong into the base environment.

如果您使用相同的程序包创建多个环境,请不要担心磁盘空间. conda很好地完成了将相同程序包硬链接到多个环境中以节省空间的工作.

Don't worry about disk space if you create multiple environments with the same packages. conda does a very good job with hard-linking the same packages into multiple environments to save space.

完整的Anaconda安装程序会将大量东西放到基本环境中.乍一看似乎很方便,但是当您开始创建新环境时,就会遇到我提到的问题.尽管没有在新环境中安装东西,但是您可以从其中调用东西.使用Miniconda可以避免这种情况,但要付出代价,那就是必须先创建一个新环境,然后才能实际使用东西.但是,有一个anaconda meta-package,您可以使用一个命令来安装该软件包,以获取大量的东西".

The full Anaconda installer puts a ton of stuff into the base environment. That might seem convenient at first, but when you start creating new environments, you'll run into the problem I mentioned. You can call stuff from your new environment although it isn't installed there. Using Miniconda avoids this, at the cost of having to create a new environment before actually being able to use stuff. However, there's an anaconda meta-package which you can install to get the "ton of stuff" with one command.

这篇关于“基础"的目的是什么? (有关最佳做法)在Anaconda中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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