克隆Anaconda基础环境时的AssertionError

Lia*_*amG 6 windows python-3.x anaconda

我正在尝试为特定应用程序创建基本anaconda环境的克隆.我想使用克隆作为安装特定于应用程序的软件包的基础.我使用以下命令启动克隆:

C:\Users\Liam>conda create -n retrievals --clone base
Run Code Online (Sandbox Code Playgroud)

它使克隆过程走了很长一段路,并且在克隆anaconda-5.2.0时刚刚达到100%,当它抛出下面的断言错误时:

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\exceptions.py", line 819, in __call__
    return func(*args, **kwargs)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\cli\main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 77, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\cli\main_create.py", line 11, in execute
    install(args, parser, 'create')
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\cli\install.py", line 211, in install
    clone(args.clone, prefix, json=context.json, quiet=context.quiet, index_args=index_args)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\cli\install.py", line 72, in clone
    index_args=index_args)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\misc.py", line 277, in clone_env
    force_extract=False, index_args=index_args)
  File "C:\Users\Liam\Anaconda3\lib\site-packages\conda\misc.py", line 78, in explicit
    assert not any(spec_pcrec[1] is None for spec_pcrec in specs_pcrecs)
AssertionError
Run Code Online (Sandbox Code Playgroud)

$ C:\Users\Liam\Anaconda3\Scripts\conda create -n retrievals --clone base

任何人都可以解释为什么会发生这种情况以及我可以尝试修复它的原因吗?

PS我在Windows 10上这样做,如果这有帮助的话.

Vla*_*ski 0

我找到了解决方法。您只需复制具有基本名称的环境即可。

cp -r /opt/conda/envs/base_env /opt/conda/envs/new_env
Run Code Online (Sandbox Code Playgroud)

之后您可以激活或更新环境。

conda activate new_env

conda env update --name new_env --file environment.yaml --prune
Run Code Online (Sandbox Code Playgroud)