Create a virtual environment

Warning

pycompwa is no longer maintained. Use the ComPWA packages QRules, AmpForm, and TensorWaves instead!

It is safest to install pycompwa within a virtual environment, so that all Python dependencies are contained within there. This is helpful in case something goes wrong with the dependencies: you can just trash the environment and recreate it. There are two options: Conda or Python’s venv.

Conda environment

Conda can be installed without administrator rights, see instructions on this page. Once installed, you can use the environment.yml file from the local repository to create a Conda environment for the pycompwa install:

conda env create -f environment.yml

This command will take a few minutes, because all required dependencies will be installed in one go through pip. After Conda finishes creating the environment, you can activate it with as follows:

conda activate pycompwa

You need to have the pycompwa environment activated whenever you want to run pycompwa.

Hint

You can automatically source your ROOT installation upon activating the pycompwa environment by adding an activate script. It’s neat to have a deactivate script as well. Under linux, this would be:

~/anaconda3/envs/pwa/etc/conda/activate.d/cern_root.sh
#!/usr/bin/env bash
source "<path to you ROOT installation>/bin/thisroot.sh"
~/anaconda3/envs/pwa/etc/conda/deactivate.d/cern_root.sh
#!/usr/bin/env bash
unset ROOTSYS

Python venv

Alternatively, you can use Python’s venv. All you have to do, is navigate into local repository and run:

python3 -m venv ./venv

This creates a folder called venv where all Python packages will be contained. You first have to activate the environment, and will have to do so whenever you want to run those Python packages.

source ./venv/bin/activate

Now you can safely install the required Python requirements through pip:

pip install scikit-build
pip install -r requirements.txt

That’s it, now you’re all set to build and install pycompwa!