install packages based on spec-list conda

Viewed 210

I have generate a spec-list below with 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

I know I could create an environment of it using:

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

But I want to install this list into base environment.However, nothing happened. Could any one help? Thanks!

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

Generally a bad idea to do this with Conda's base,1 however, to install additional packages with a specification list, one uses the conda update command, e.g.

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

[1] For example, even in that little snippet shared by OP, we see a conda-env package. That package has been deprecated for years and will potentially conflict with a contemporary version of conda, which now packages both conda and conda-env Python modules.

Related