使用所有包创建 anaconda python 环境

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38066873/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:17:03  来源:igfitidea点击:

create anaconda python environment with all packages

pythonanaconda

提问by Neeraj

I want to create an anaconda python environment with allof the packages that Continuum includes in its default Anaconda installer. Based on some internet search I used the following command:

我想创建一个 anaconda python 环境,其中包含 Continuum 包含在其默认 Anaconda 安装程序中的所有软件包。基于一些互联网搜索,我使用了以下命令:

conda create -n env_full python=3

However, only handful of packages would be installed. Please see the screen shot.enter image description here

但是,只会安装少数软件包。请查看屏幕截图。在此处输入图片说明

Kindly guide me to use correct commands.

请指导我使用正确的命令。

Right now I am trying to do this on a desktop computer, but I would like to apply the same principles to the cluster facility.

现在我正尝试在台式计算机上执行此操作,但我想将相同的原则应用于集群设施。

回答by Michael Grant

Surely you don't mean install allavailable packages, right? Continuum's default channel alone has 635 of them, and there are countless others on other channels.

你当然不是说安装所有可用的软件包,对吗?仅 Continuum 的默认频道就有 635 个,其他频道上还有无数其他频道。

I think @cel is right above to assume that you're specifically asking to install all of the packages that Continuum includes in its default Anaconda installer. If that's the case, then the simplest command is this:

我认为 @cel 就在上面假设您特别要求安装 Continuum 包含在其默认 Anaconda 安装程序中的所有软件包。如果是这种情况,那么最简单的命令是:

conda create -n env_full anaconda

This will install the latest version of the anacondapackage set, as compiled for your default version of Python (the one you used to install Anaconda originally). If you'd like to create an environment with a different version of Python, then just add that to the command line; e.g.

这将安装最新版本的anaconda软件包集,为您的默认 Python 版本(您最初用于安装 Anaconda 的版本)编译。如果您想使用不同版本的 Python 创建一个环境,只需将其添加到命令行即可;例如

conda create -n env_full anaconda python=2.7
conda create -n env_full anaconda python=3.5

回答by DevC

Anaconda ships with a root env, this is named as base. You can use this as it is or clone a new environment from it.

Anaconda 附带一个 root env,它被命名为 base。您可以按原样使用它或从中克隆一个新环境。

if you just want a environment with all the packages for day to day then you can use the base enviornment itself.

如果您只想要一个包含所有日常包的环境,那么您可以使用基本环境本身。

you can list the all available conda env on your machine as follows

您可以列出您机器上所有可用的 conda env,如下所示

 conda info --env

you will see a enviornment name base, activate it to use it

您将看到一个环境名称库,激活它以使用它

 source activate base

You can verify all the packages available in the env with following command ( This work with any env created with conda)

您可以使用以下命令验证 env 中可用的所有包(这适用于使用 conda 创建的任何 env)

 conda list -n base

As I said above if you want a different env then you can clone base using following command

正如我上面所说,如果你想要一个不同的环境,那么你可以使用以下命令克隆 base

conda create --name <env_name> --clone base