🐍 conda environments made simple

a few commands to get started using conda envs with jupyter
like a cheatsheet but nicer

Acknowledgements

site idea stolen from Roger Dudler's awesome Git guide
https://rogerdudler.github.io/git-guide/

and Vincent Warmerdam's great explanations
calmcode.io/virtualenvs

setup

install conda

install jupyter

new environment

create a new environment with a specific python version
conda create -n my_environment python=3.8
create copy of existing environment
conda create --clone original_env --name copy_env

checkout environments

print environments available
conda info --envs

activate/deactivate

to start working in your environment you need to activate it
conda activate my_environment
to deactivate it and return to base just
conda deactivate my_environment

kernel

you first have to install the kernel
conda install -c anaconda ipykernel
then make the new environment available there
ipython kernel install --user --name=my_environment
you should now be able to run jupyter from your new env!

remove

if you are done with the environment
conda env remove -n my_environment