Skip to content
Christian Brodbeck edited this page Aug 14, 2023 · 6 revisions

Anaconda Version Pre-release Version Anaconda Platforms

The recommended way to use Eelbrain is with Continuum Analytics' Anaconda, using a dedicated Conda environment.

Tip
For faster environment management, replace conda with mamba

Installing the release version

This will create a conda environment with all the necessary components installed.

Note
See Trouble-shooting advice

Through a command-line

The following line will generate an environment with the latest version:

$ conda create -n eelbrain -c conda-forge eelbrain

To install a specific version, modify the last eelbrain in the line above to, for example, eelbrain=0.29.

To install other useful libraries at the same time:

$ conda create -n eelbrain -c conda-forge eelbrain jupyterlab seaborn

To use this environment, activate it with

$ conda activate eelbrain
(eelbrain) $

The leading (eelbrain) in the second prompt indicates that the environment is now active.

Through Anaconda Navigator

The Anaconda Navigator comes with the Anaconda Python distribution and provides a GUI for managing environments.

  • On the left, click Environments

  • At the top, click Channels (this has to be done only once)

    • Click Add

    • Type conda-forge and hit enter

    • Click Update channels

  • At the bottom left, click Create

    • Give the environment a name (e.g. eelbrain)

    • Below select the latest Python 3.x version for which Eelbrain is available

    • Click Create

  • Now, select the drop-down menu at the top that currently says installed and select Not installed

  • You might have to click Update index…​ to the left

  • In the Search Packages box type eelbrain

  • Click the check-box to the left of the package that appears

  • Click Apply at the bottom

  • When the Install packages dialog appears, click Apply again

In order to use the environment:

  • Select the Home tab on the left

  • In the top left drop-down menu select the environment

  • Launch the preferred Application (e.g. VS Code)

Optional extensions

  • Eelbrain provides functions to interface with R if rpy2 is installed.

  • A working LaTeX installation enables exporting tables as pdf.

Updating

To update Eelbrain in an existing environment, run

$ conda update -c conda-forge eelbrain

Or for installing a specific version:

$ conda install -c conda-forge eelbrain=0.29

Making your analysis future-proof

Newer version of Eelbrain support files generated with previous versions. However, running the same code with different versions can lead to slightly different results. This does not just apply to Eelbrain, but equally to the libraries it relies on like NumPy and MNE-Python, and happens for example when underlying implementations change, which can lead to different rounding errors. These changes should be very small, but they can sometimes change a p-value slightly, so it might be undesirable when revisiting at a previously finished analysis. In order to be able to replicate results exactly in the future, it might be useful to keep a record of the environment with which the analysis was done.

Pre-release versions

Sometimes pre-release versions are available with new or experimental features (check the version number in the badge at the top of this page). These pre-releases can be installed by including the conda-forge/label/eelbrain_dev channel. To create a new environment with a specific version, use for example:

$ conda create -n eelpre -c conda-forge/label/eelbrain_dev -c conda-forge "eelbrain = 0.36a0"

To update, install into an existing environment:

$ conda install -c conda-forge/label/eelbrain_dev -c conda-forge "eelbrain = 0.38a4"

A branch from GitHub

Download the environment file and create the eeldev conda environment:

$ curl -O https://raw.githubusercontent.com/christianbrodbeck/Eelbrain/master/env-dev.yml
$ conda env create --file=env-dev.yml

Activate the environment:

$ conda activate eeldev

Install the relevant development branch into the environment. If installing a specific branch, replace "master" with the branch name:

$ pip install https://github.com/christianbrodbeck/Eelbrain/archive/master.zip

NOTE: In order for this to work on macOS, the Xcode Command Line Tools need to be installed. If they are not, the pip install command will fail with a long error message including fatal error: 'stdio.h' file not found. In order to install the Command Line Tools, run:

$ xcode-select --install

Git repository for development

On the Eelbrain GitHub site, create a fork of Eelbrain by clicking the Fork button. Clone your fork to your local computer (execute this command from the directory in which you want the Eelbrain source folder to be located):

$ git clone https://github.com/<username>/Eelbrain.git

Changing into the new Eelbrain folder and generate the development environment:

$ cd Eelbrain
$ conda env create --file=env-dev.yml

Activate the environment, then install Eelbrain into it with

$ conda activate eeldev
$ pip install -e .

MacOS only: patch the $ eelbrain command to use the framework build of Python

$ ./fix-bin

Tests that involve GUIs also need to be run with a framework build; in order to do that, also patch pytest with

$ ./fix-bin pytest