Installation

The BSB framework is tested and documented for Python versions 3.10, 3.11 and 3.12.
Support and compatibility are not guaranteed for the other versions of Python.

Tip

We highly recommend you to use python virtual environments to install BSB!

The BSB framework can be installed using pip:

pip install bsb

You can verify that the installation works with:

from bsb import Scaffold

# Create an empty scaffold network with the default configuration.
scaffold = Scaffold()

You have now the minimal installation required to complete the getting started section.

Parallel support

The BSB parallelizes the network reconstruction using MPI, and translates simulator instructions to the simulator backends with it as well, for effortless parallel simulation. To use MPI from Python the mpi4py package is required, which in turn needs a working MPI implementation installed in your environment.

On your local machine, first install MPI:

sudo apt-get update && sudo apt-get install -y libopenmpi-dev openmpi-bin
# You need to have xcode installed.
# For Homebrew
brew install openmpi

# For MacPorts
port install openmpi

For Windows, you would need to install C/C++ compiler as well as the Microsoft MPI program.

On supercomputers it is usually installed already, otherwise contact your administrator.

To then install the BSB with parallel MPI support:

pip install bsb[parallel]

You can run any bsb command or python scripts with MPI with the mpirun command, specifying the number of core to allocate:

# run the BSB reconstruction with 5 cores
mpirun -n 5 bsb compile my-config.json -v 3

# run a python script in parallel with 4 cores
mpirun -n 4 python my-script.py

Simulator backends

If you would like to install the scaffold builder for point neuron simulations with NEST or multi-compartmental neuron simulations with NEURON or Arbor use:

pip install bsb[nest]
# or
pip install bsb[arbor]
# or
pip install bsb[neuron]
# or any combination
pip install bsb[arbor,nest,neuron]

Warning

The NEST simulator is not installed with the bsb-nest package and should be set up separately. It installs the Python tools that the BSB needs to interface NEST. Install NEST following to their installation instructions .

Developer installation

First, make sure you have followed the Parallel support guidelines.

In order for you to manage the monorepo aspects using nx, you’ll have to install NodeJS. There is helper scripts for each platform in devtools/bootstrap-*:

git clone https://github.com/dbbs-lab/bsb
cd bsb
./devtools/bootstrap-linux.sh
git clone https://github.com/dbbs-lab/bsb
cd bsb
./devtools/bootstrap-mac.sh
git clone https://github.com/dbbs-lab/bsb
cd bsb
.\devtools\bootstrap-windows.ps1

Note

As a non-JavaScript Nx repo we use an alternative installation method which does not have a package.json file at the root, and instead declares its bootstrapping in the installation key of nx.json. Whenever you run ./nx, the scripts - via .nx/nxw.js - will bootstrap an Nx installation in the .nx folder, with the typical package.json and node_modules maintained in the .nx/installation folder.

Hint

You can npm install -g nx so that you can use regular nx command without having to point to the ./nx path.

If you want to have more information about our development guidelines, please read our developer guides

What is next

You can start learning about the BSB by reading the Getting Started section