根据 spec-list conda 安装包

install packages based on spec-list conda

我在下面生成了一个规格列表 conda list --explicit > spec-list.txt

# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://repo.anaconda.com/pkgs/main/linux-64/conda-env-2.6.0-1.conda
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
https://repo.anaconda.com/pkgs/main/noarch/_sysroot_linux-64_curr_repodata_hack-3-haa98f57_10.tar.bz2
https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-mkl.conda
https://repo.anaconda.com/pkgs/main/linux-64/ca-certificates-2021.10.26-h06a4308_2.conda
https://repo.anaconda.com/pkgs/main/linux-64/intel-openmp-2021.2.0-h06a4308_610.conda
https://repo.anaconda.com/pkgs/main/linux-64/ld_impl_linux-64-2.35.1-h7274673_9.conda
https://repo.anaconda.com/pkgs/main/linux-64/libgcc-devel_linux-64-9.3.0-hb95220a_17.conda

我知道我可以使用以下方法创建它的环境:

conda create --name python-course --file spec-list.txt

但我想将此列表安装到基础 environment.However 中,但没有任何反应。有人能帮忙吗?谢谢!

$ conda install --name base --file spec-list.txt
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

一般来说,使用 Conda 的 base1 执行此操作是个坏主意,但是,安装带有规格列表的附加包,一个使用 conda update 命令,例如

conda update -n foo --file spec-list.txt

[1] 例如,即使在 OP 共享的那个小片段中,我们也看到了一个 conda-env 包。该软件包已被弃用多年,可能会与现代版本的 conda 发生冲突,后者现在同时包含 condaconda-env Python 模块。