使用所有包创建 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
create anaconda python environment with all packages
提问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.
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 anaconda
package 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