简体   繁体   English

conda在创建ipykernel时无法克隆环境

[英]conda can't clone an environment when creating an ipykernel

I'd like to avoid installing every individual package in a new environment with the following command in anaconda3: 我想避免在anaconda3中使用以下命令在新环境中安装每个包:

conda create -n py3 ipykernel --clone root

but I get this error: 但我得到这个错误:

TooManyArgumentsError: Too many arguments: did not expect any arguments for --clone. Got 1 argument (ipykernel) and expected 0.

First cloning the environment and then installing ipykernel also doesn't work: 首先克隆环境,然后安装ipykernel也不起作用:

~>conda create -n py3 --clone root
[...]
~>source activate py3
(py3) ~>conda install ipykernel
Fetching package metadata .......
Solving package specifications: ..........


InstallError: Install error: Error: one or more of the packages already installed depend on 'conda'
and should only be installed in the root environment: conda-env
These packages need to be removed before conda can proceed.

My end goal is to have a couple envs I can launch in jupyter notebook. 我的最终目标是拥有一些我可以在jupyter笔记本中启动的环境。 I'd like to avoid having to reinstall every package for every env in the case that the python version is the same as [root] env. 在python版本与[root] env相同的情况下,我想避免为每个env重新安装每个包。 Having just downloaded the full anaconda distribution, I find myself rebuilding it piecemeal into the environment. 刚刚下载了完整的anaconda发行版,我发现自己在零碎的环境中重建它。 I'm wondering if there is a better way to do this. 我想知道是否有更好的方法来做到这一点。

Conda itself can only be installed in root. Conda本身只能安装在root中。 Just follow the instructions. 按照说明操作。 Inside your new environment, uninstall conda-env : 在新环境中,卸载conda-env

(py3) ~> conda unistall conda-env

Now, try to install again: 现在,尝试再次安装:

(py3) ~>conda install ipykernel

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

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