This short summary is based on the Anaconda blog post here https://www.anaconda.com/moving-conda-environments/. The original blog post is a great high-level summary for the various methods in conda for reproducing environments.
# On source environment:
conda list --explicit > spec-list.txt
# New conda environment:
conda create --name new_env_name --file spec-list.txt
pip
installed packages)
# On source environment:
conda env export > env.yml
# New conda environment:
conda env create -f env.yml
# On source environment:
conda install -c conda-forge conda-pack
conda pack -n env_name \
-o out_name.tar.gz \
-p /path/to/pack/
# New conda environment:
mkdir -p env_name
tar -xzf out_name.tar.gz -C env_name
source env_name/bin/activate
conda-unpack