see anaconda environments code example
Example 1: conda create env from yml
conda env create -f environment.yml
Example 2: delete conda environment
conda remove --name myenv --all
conda env create -f environment.yml
conda remove --name myenv --all