Make sure you update the conda and install python:
conda update conda
conda install python=3.X
You can follow the below steps to activate the environment with few commands:
source activate environment-name
source conda activate environment-name
Below commands helped me in building conda environment:
#build the conda environment
ENV ENV_PREFIX $PWD/env
RUN conda update --name base --channel defaults conda && \
conda env create --prefix $ENV_PREFIX --file /tmp/environment.yml --force && \
conda clean --all --yes# run the postBuild script to install any JupyterLab extensions
RUN conda activate $ENV_PREFIX && \
/usr/local/bin/postBuild.sh && \
conda deactivate
You can have a look on the links mentioned by DeepDave.