brainpylib is designed to run cross platforms, including Windows, GNU/Linux, and OSX.

Installation with pip#

You can install brainpylib from the pypi. To do so, use:

pip install brainpylib

To update the latest version, you can use

pip install -U brainpylib

If you want to install the pre-release version (the latest development version) of brainpylib, you can use:

pip install --pre brainpylib

Installation from source#

If you decide not to use pip, you can install brainpylib from GitHub.

To do so, use:

pip install git+

Compile GPU operators#

We currently did not provide GPU wheel on Pypi and users need to build brainpylib from source if you want to GPU operators. There are some prerequisites first:

  • Linux platform.

  • Nvidia GPU series required.

  • CUDA and CuDNN have installed.

We have tested whole building process on Nvidia RTX A6000 GPU with CUDA 11.6 version.

First, obtain the source code:

git clone
cd brainpylib

Then compile GPU wheel via:

python bdist_wheel

After compilation, it’s convenient for users to install the package through following instructions:

pip install dist/brainpylib-*.whl

brainpylib-*.whl is the generated file from compilation, which is located in dist folder.

Now users have successfully install GPU version of brainpylib, and we recommend users to check if brainpylib can be imported in the Python script.