Brain Innovation

support portal


BrainVoyager Automation & Development Writing Scripts Writing scripts for BrainVoyager in Python

Writing scripts for BrainVoyager in Python


The documentation can be opened via the BrainVoyager menu > Python > Python Developer Guide. An unofficial list of functions can be found here: PDF. Example scripts can be found after installation of BrainVoyager in the directory /(My) Documents/BrainVoyager/PythonScripts/. A few extra scripts can be found on this support page.

Screenshot 2021 12 07 at 17.10.27

A non-official, community-driven API reference can be found at

Tips for importing modules in a Python script for BrainVoyager

1. Make the path to the module available before importing. For example, if the module to import is located in /Documents/BrainVoyager/PythonScripts/, the command could be:

import os
import sys
scriptsdir = brainvoyager.choose_directory("Select the test scripts directory")
import name_of_module

2. Avoid installing the package as egg in the site-packages directory of the conda environment for Python in BrainVoyager using the following installation command in the directory that contains

pip install .

For example, download a *.zip file of bvbabel  Unzip the file. In the shell (Linux)/Terminal (macOS) /Conda prompt window (Windows), activate the Miniconda environment

conda activate env_bv_py38

then go into the bvbabel directory with the unzipped files via 'cd' (change directory). Type

$ pip install .

bvbabel should now be installed in opt/miniconda3/envs/env_bv_py38/lib/python3.8/site-packages/

From Stackoverflow


Please note that since BrainVoyager 22, Python code can be automatically generated in a BrainVoyager NoteBook (*.bvnb). This can be performed by clicking the icon "Log BV GUI Actions As Code" (see upper right corner in snapshot below).

AutoGenerationPythonCode BV22


You are here: HomeBrainVoyagerAutomation & DevelopmentWriting Scripts ≫ Writing scripts for BrainVoyager in Python