Python Setup

In order to install the python library, it is recommended to create a python virtual environment where you can install all dependencies. Therefore, you will first need a package management system to create the python environment. This way, you can avoid package conflicts with packages you may need for different software projects. In general, we recommend using uv due to its speed, but as many users are familiar with conda, we also describe its usage as well.

uv

To install uv please follow the instructions on the uv installation page. No further requirements (like installing python) are needed, as uv takes care of everything for you.

Creating a virtual environment with uv can be done via

uv venv .venv --python 3.10

This will create a folder .venv/ which contains all information on the virtual environment. Note, that you can choose a different python version by simply changing the version number.

To activate the virtual environment, you can run

# For Linux and MacOS users
source .venv/bin/activate

# For Windows users
.venv\Scripts\activate

In order to install all build dependencies for pairinteraction, run

uv pip install -r .build_requirements.txt

inside the pairinteraction repository.

If in addition you want to install all dependencies from the pyproject.toml file, you can use the following commands:

uv pip compile pyproject.toml --all-extras > requirements.txt
uv pip install -r requirements.txt

Conda

To install conda please follow the instructions on the conda installation page.

Creating and activating a virtual environment that is able to use all pip functionality with conda can be done by running the following commands:

conda create --name venv python=3.10
conda activate venv
conda install pip-tools

In order to install all dependencies to build the package, you can run from inside the conda environment and the root directory of the pairinteraction repository

pip install -r .build_requirements.txt

If in addition you want to install all dependencies from the pyproject.toml file, you should use the following commands:

pip-compile pyproject.toml --all-extras --output-file=requirements.txt
pip install -r requirements.txt