Skip to content

There are several Python resources you can check. Some good resources for the type of work we do are the MolSSI Education Resources for Python, Scientific Computing from Scratch, and Python Computations in Science and Engineering. 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 miniconda, a lighter version of Anaconda, on your local machine so you can run Python code locally.

Installation

Download and execute the Miniconda installer found here. You should select the option to add conda to your PATH environment variable. Ignore the warning.

Creating a Conda Environment

Once that's done, we will create and activate an environment called myconda with a specific Python version, and then install relevant packages.

conda create --name myconda python=3.11
conda activate myconda
pip install jupyter uv ase

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.

Delete a Conda Environment

More often than one would like, you'll need to destroy your conda environment and start fresh if things get messy. To do that:

conda env remove --name myconda

Then re-create your conda environment like before.

Setup on Our Clusters

On clusters you can use either conda or mamba. Generally, mamba is considered faster and more efficient in HPC systems, while conda offers wider support. The best choice might be to look at the cluster documentation and see which one is supported and recommended.

Metacentrum

In Metacentrum, both conda and mamba are supported, so feel free to use whichever one you prefer. Below is an example of how to set up a mamba environment:

# Create a path for your environments
mkdir $HOME/envs/
# Load mamba
module load mambaforge
# Create a new environment in your folder
mamba create --prefix $HOME/envs/mymamba python=3.13
# Activate the environment
mamba activate $HOME/envs/mymamba
# Export environment for sharing
mamba env export --from-history > mymamba_env.yml
# Deactivate the environment
mamba deactivate

When running jobs that require a particular mamba environment, you just need to add to your submission file:

module load mambaforge
mamba activate $HOME/envs/mymamba

Shared Environments

Several group members have created working mamba environments containing most of the packages used in our day-to-day activities:

Path Packages Responsible
/storage/praha1/home/carlosbornes/load_janus MACE, ASE, Janus Carlos
/storage/praha2-natur/home/a_erlebach/load_schnet2 SchNet 2, ASE Andi

You can check all installed packages by loading the conda environment with source /storage/praha1/home/carlosbornes/load_janus and then listing the packages with mamba list or conda list.