Installation#

braincell is a pure-Python package built on JAX and brainstate. It runs on Linux, macOS, and Windows (via WSL), and requires Python 3.10 or newer.

Quick install#

The fastest way to get a working CPU install:

pip install -U braincell[cpu]

This pulls in braincell together with a CPU build of JAX.

Choosing a hardware backend#

braincell inherits JAX’s hardware support. Pick the extra that matches your accelerator:

pip install -U braincell[cpu]
pip install -U braincell[cuda12]

# or, for CUDA 13
pip install -U braincell[cuda13]
pip install -U braincell[tpu]

Note

If you install plain braincell without a hardware extra and no JAX build is present, JAX falls back to CPU. If you have an NVIDIA GPU but installed only the CPU build, you will see a message like “An NVIDIA GPU may be present … falling back to cpu” — install the matching cuda extra to use the GPU.

Optional feature groups#

Several capabilities depend on optional libraries, grouped as install extras:

Extra

Installs

Enables

braincell[vis]

matplotlib, pyvista, plotly

2-D and 3-D visualization (braincell.vis)

braincell[io]

requests

the NeuroMorpho.Org client (braincell.io)

braincell[all]

all of the above

every optional feature

Extras combine, so you can request several at once:

pip install -U "braincell[cpu,vis,io]"

Install with the full ecosystem#

braincell is part of the BrainX ecosystem. To get braincell together with the rest of the stack:

pip install -U BrainX

Development install#

To work on braincell itself, clone the repository and install it in editable mode with the testing extras:

git clone https://github.com/chaobrain/braincell.git
cd braincell
pip install -e ".[testing]"

Then install the pre-commit hooks and run the test suite to confirm everything works:

pre-commit install
pytest braincell/

See the Developer Guide for the project layout, testing conventions, and contribution workflow.

Verifying the install#

import braincell
print(braincell.__version__)

A successful import that prints a version string means you are ready to go. Continue to Overview & Roadmap for a map of the library, or jump straight to First Steps to run your first model.

Windows + NEURON (optional)#

Some validation examples compare braincell against the NEURON simulator. If you are on Windows and want a WSL-based development setup with NEURON 8.2.6 and nrnivmodl. NEURON is not required to use braincell.