The instructions below are for setting up Anaconda on your local machine so you can run Python code locally.
Installation
Download and execute the Anaconda installer found here. You should select the option to add conda to your PATH environment variable. Ignore the warning.
Making a Conda Environment
Once that's done, we will create and activate an environment called cms and install a relevant package.
conda create --name cms python=3.11
conda activate cms
pip install jupyter uv
It is generally best to keep your base conda environment clean and to rely on other environments instead for installing new packages. It is often wise to make a conda environment for each project as a matter of reproducibility and ease of use.
Every now and then, you should run conda clean --all to remove the cached installers that end up accumulating a lot of space.
Nuking a Conda Environment
More often than one would like, you'll need to destroy your conda environment and start fresh if things just get messy. To do that:
conda env remove --name cms
Then re-make your Conda environment like before.
Setup on the Clusters
Princeton HPC
The Princeton Research Computing team provides an Anaconda distribution on the compute clusters, as described in the Knowledge Base. All you have to do is load the most recent module, create an environment, and optionally link it to Jupyter Lab so you can use the Jupyter Notebooks. An example is shown below to make an environment named cms.
You may optionally choose to load the Anaconda module upon log-in for convenience and potentially even activate a default environment. To do so, add the following to your ~/.bashrc: