Installing from sources#

If you want to test features under development or contribute to the library, or if you want to test the new tools that have been tested in moabb and not released yet, this is the right tutorial for you!

Note

If you are only trying to install MOABB, we recommend using the pip installation Installation for details on that.

Clone the repository from GitHub#

The first thing you should do is clone the MOABB repository to your computer and enter inside the repository.

git clone https://github.com/neurotechx/moabb && cd moabb

You should now be in the root directory of the MOABB repository.

Installing Moabb from the source#

If you want to only install Moabb from source once and not do any development work, then the recommended way to build and install is to use pip:

For the latest development version, directly from GitHub:

pip install https://github.com/NeuroTechX/moabb/archive/refs/heads/develop.zip

If you have a local clone of the MOABB git repository:

pip install .

You can also install MOABB in editable mode (i.e. changes to the source code).

Building MOABB from source with the development environment#

If you want to build from source to work on MOABB itself, then follow these steps:

  1. Install poetry by running the following command (only needs to be done once per machine):

curl -sSL https://install.python-poetry.org | python3 -

You could also check checkout poetry installation instruction or use conda forge version

We need the most updated version of the poetry to ensure the compatibility with optional dependency.

Note

If you have any group-related errors at the end of this section, you may not run the proper version of poetry.

  1. (Optional) We recommend disabling automatic environment creation:

poetry config virtualenvs.create false

Note

This step is optional. Skip if you are not sure.

  1. If you want to install without any optional dependency

You will need to run this command in the project directory:

poetry install
  1. If you want to install with an optional dependency

You will need to run this command in the project directory:

poetry install --extras "deeplearning carbonemission docs"

For a full list of dependencies, see the pyproject.toml file.

To contribute with a library you must install pre-commit, follow this tutorial Installation Pre-Commit. To more details to become a contributors, see contributors’ guidelines. for a detailed explanation.

Testing if your installation is working#

To verify that MOABB is installed and running correctly, run the following command:

python -m unittest moabb.tests

For more information, please see the contributors’ guidelines.