Installation Instructions
The brian2wasm package is compatible with Linux, macOS, and Windows. It depends on the Brian 2 simulator and the Emscripten toolchain. Using the Pixi package manager is recommended, as it automatically handles these dependencies.
Installation with Pixi
Pixi is a modern, cross-platform package and environment manager that simplifies the setup of brian2wasm and its dependencies.
To install and use brian2wasm with Pixi:
Install Pixi:
For Linux or macOS:
curl -fsSL https://pixi.sh/install.sh | sh
For Windows:
powershell -ExecutionPolicy Bypass -c "irm -useb https://pixi.sh/install.ps1 | iex"
Alternatively, refer to the official Pixi installation instructions.
Set up brian2wasm:
git clone https://github.com/brian-team/brian2wasm.git cd brian2wasm pixi install # Installs Python, Emscripten, Brian 2, and other dependencies pixi run setup # Activates Emscripten SDK (one-time step) pixi shell # Enters the environment shell
Tip
Run
pixi shellwhenever you start a new session to access the configured environment.Warning
Ensure you are in the
brian2wasmdirectory before runningpixi installto avoid setup errors.
Installation with Conda (Experimental)
Warning
The Conda installation method is under development and may not be fully stable. Consider using Pixi for a more reliable experience.
To install and use brian2wasm with Conda:
Create a Conda environment:
conda create -n brian2wasm python
Activate the environment:
conda activate brian2wasm
Install brian2wasm:
conda install brian2wasm -c conda-forge
Note
Ensure the
conda-forgechannel is added to your Conda configuration. Runconda config --add channels conda-forgeif needed.
Installation with PIP
If you have a pre-configured Emscripten SDK (EMSDK) installed, you can install brian2wasm using PIP.
To install brian2wasm with PIP:
pip install brian2wasm
Warning
PIP installation requires a properly configured Emscripten SDK. Without it, the installation will fail. Refer to the Emscripten documentation for setup instructions.
Tip
Verify your Emscripten installation by running emcc --version before using PIP to install brian2wasm.