Install

Installing in an existing python environment with pip

First, make sure that numpy is installed in your python environment:

pip install 'numpy<2.0'

Then, install pNbody running:

pip install ./pNbody

where ./pNbody is the directory cloned from gitlab.

Installing pNbody in a specific directory is achieved with the --prefix option:

pip install --prefix=/where/you/want/to/install/it ./pNbody

Installing using a fresh Python Virtual Environment

Make sure that the PYTHONPATH variable is not set:

unset PYTHONPATH

Create a python virtual environment and activate it:

python3 -m venv ~local/python-venv/pNbody
source ~local/python-venv/pNbody/bin/activate

Install numpy:

pip install 'numpy<2.0'

Install pNbody:

pip install ./pNbody

Installing using a Conda Environment

Make sure that the PYTHONPATH variable is not set:

unset PYTHONPATH

Create a new conda environment and activate it:

conda create -n pNbody-env
conda activate pNbody-env

Install numpy:

conda install 'numpy<2.0'

Install pNbody:

pip install ./pNbody

Troubleshooting

In some rare cases some libraries can be missing, leading to a crash of the installation. In this case it can be useful to edit the setup.py file before running pip install.