Create env with python 3.7 and pip
conda create --name whatwhale python=3.7 pip
Activate by name
conda activate whatwhale
conda deactivate
Remove environment by name
# remove env
conda env remove --name whatwhale
# verify
conda env list
List packages in active environment
conda list
List packages in environment using name
conda list --name whatwhale
Install flask in active environment
conda install flask
Install flask in environment using name
conda install --name whatwhale flask
It is recommended to only install packages with pip if conda install
does not work.
Install pip into active environment
conda install pip
pip install <package-name>
Produce a spec list file
conda list --explicit > requirements.txt
Create an environment.yml
file
conda env export --from-history > environment.yml
Build a new environment from spec list file
conda create --name myenv -f requirements.txt
Recreate from environment.yml
file
conda env create -f environment.yml
Update an existng environment from spec list file
conda install --name myenv --file requirements.txt
Update an existng environment from environment.yml
file
conda env update --name myenv --file environment.yml --prune