Anaconda environments and set-up
-
Install Miniconda. This is recommended as it uses much less space than the full Anaconda distribution, while still providing the package manager, conda. When installing, I like to select "Add Anaconda to path...", even though it is not recommended. I find the Anaconda prompt to be slow and I would rather just boot things through the terminal.
-
To create an environment from scratch, run:
conda create --name myenvname
Otherwise, build from an environment.yml file as (note that the name of the env is defined in the first line of environment.yml):
conda env create -f environment.yml
-
Set-up IPython kernels (docs here). From within a given environment, the name of the kernel can be defined by running:
conda activate myenv python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
This ensures that the environment will show up as a kernel in your jupyter notebooks.
-
Make sure the base environment has numpy installed. There seems to be an issue with this currently.
-
To update an environment.yml file:
conda env export > environment.yml
-
Update an existing environment based on a new environment.yml file:
conda env update --file environment.yml