Python Setup

Looking for resources to become more proficient with Python? Check out the  MolSSI Education Resources for Python ,  Scientific Computing from Scratch , or  Python for Everybody . That said, there are nearly unlimited free resources out there, so use what works well for you!

Setup on your Local Machine

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.
module load anaconda3/2024.10
conda create --name cms python=3.11

conda activate cms
pip install ipykernel
python -m ipykernel install --user --name cms --display-name 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:
module load anaconda3/2024.10
conda activate cms