Skip to main content

DOI

Muse LSL

A Python package for streaming, visualizing, and recording EEG data from the Muse devices developed by InteraXon.

Blinks

Requirements

The code relies on a number of different bluetooth backends for connecting to the muse. We recommend using the bleak backend (enabled by default), but you may be interested in BlueMuse for a GUI to discover and connect to Muse devices on Windows or [bgapi] if you are on a Mac with a BLED112 dongle.

Requires Python 3.9+ (we recommend Python 3.10–3.12)

Compatible with Muse 2, Muse S, and the classic Muse (2016)

Note: if you run into any issues, first check out out Common Issues and then the Issues section of this repository

Getting Started

Installation

muselsl is both a command-line tool and a Python library. Pick the path that matches how you want to use it.

As a command-line tool (recommended for most people)

The simplest way to get the muselsl command is pipx, which installs it in its own isolated environment and puts it on your PATH — no virtual environment to manage.

macOS

brew install pipx
pipx ensurepath        # one-time: adds pipx's app folder to your PATH
# close and reopen your terminal once after running ensurepath
pipx install muselsl

Linux (Debian/Ubuntu; use your distro's package manager elsewhere)

sudo apt install pipx
pipx ensurepath        # one-time: adds pipx's app folder to your PATH
# close and reopen your terminal once after running ensurepath
pipx install muselsl

Windows (PowerShell, using the official python.org Python)

py -m pip install --user pipx
py -m pipx ensurepath
# close and reopen your terminal once after running ensurepath
pipx install muselsl

Once installed, the muselsl command works from anywhere:

muselsl list

As a library (for use inside your own Python project)

Install it into a virtual environment with pip:

python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install muselsl

Setting Up a Stream

On Windows 10, we recommend using the BlueMuse GUI to set up an LSL stream. On Mac and Linux, the easiest way to get Muse data is to use Muse LSL directly from the command line. Use the -h flag to get a comprehensive list of all commands and options.

To print a list of available muses:

$ muselsl list

To begin an LSL stream from the first available Muse:

$ muselsl stream  

To connect to a specific Muse you can pass the name of the device as an argument. Device names can be found on the inside of the left earpiece (e.g. Muse-41D2):

$ muselsl stream --name YOUR_DEVICE_NAME

You can also directly pass the MAC address of your Muse. This provides the benefit of bypassing the device discovery step and can make connecting to devices quicker and more reliable:

$ muselsl stream --address YOUR_DEVICE_ADDRESS

Working with Streaming Data

Once an LSL stream is created, you have access to the following commands.

Note: the process running the stream command must be kept alive in order to maintain the LSL stream. These following commands should be run in another terminal or second process

To view data:

$ muselsl view

If the visualization freezes or is laggy, you can also try the alternate version 2 of the viewer. Note: this will require the additional vispy and mne dependencies

$ muselsl view --version 2

To record EEG data into a CSV:

$ muselsl record --duration 60  

Note: this command will also save data from any LSL stream containing 'Markers' data, such as from the stimulus presentation scripts in EEG Notebooks

Alternatively, you can record data directly without using LSL through the following command:

$ muselsl record_direct --duration 60

Note: direct recording does not allow 'Markers' data to be recorded

Running Experiments

Muse LSL was designed so that the Muse could be used to run a number of classic EEG experiments, including the P300 event-related potential and the SSVEP and SSAEP evoked potentials.

The code to perform these experiments is still available, but is now maintained in the EEG Notebooks repository by the NeuroTechX community.

Usage as a Library

If you want to integrate Muse LSL into your own Python project, you can import and use its functions as you would any Python library. Examples are available in the examples folder:

from muselsl import stream, list_muses

muses = list_muses()
stream(muses[0]['address'])

# Note: Streaming is synchronous, so code here will not execute until after the stream has been closed
print('Stream has ended')

Alternate Data Types

In addition to EEG, the Muse also provides data from an accelerometer, gyroscope, and, in the case of the Muse 2, a photoplethysmography (PPG) sensor. These data types can be enabled via command line arguments or by passing the correct parameters to the stream function. Once enabled, PPG, accelerometer, and gyroscope data will streamed in their own separate LSL streams named "PPG", "ACC", and "GYRO", respectively.

To stream data from all sensors in a Muse 2 from the command line:

muselsl stream --ppg --acc --gyro

As a library function:

from muselsl import stream, list_muses

muses = list_muses()
stream(muses[0]['address'], ppg_enabled=True, acc_enabled=True, gyro_enabled=True)

To record data from an alternate data source:

muselsl record --type ACC

Note: The record process will only record from one data type at a time. However, multiple terminals or processes can be used to record from multiple data types simultaneously

What is LSL?

Lab Streaming Layer or LSL is a system designed to unify the collection of time series data for research experiments. It has become standard in the field of EEG-based brain-computer interfaces for its ability to make seperate streams of data available on a network with time synchronization and near real-time access. For more information, check out this lecture from Modern Brain-Computer Interface Design or the LSL repository

Common Issues

Mac and Windows

  1. Connection issues with BLED112 dongle:
  • You may need to use the --interface argument to provide the appropriate COM port value for the BLED112 device. The default value is COM9. To setup or view the device's COM port go to your OS's system settings
  1. error: externally-managed-environment when running pip install (macOS/Linux):
  • This is expected on modern, package-manager-provided Pythons (PEP 668). Don't use --break-system-packages; instead install the CLI with pipx, or install into a virtual environment, as described in Installation.

Linux

  1. pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: Operation not permitted (Linux)
  • This is an issue with pygatt requiring root privileges to run a scan. Make sure you have libcap installed and run sudo setcap 'cap_net_raw,cap_net_admin+eip' `which hcitool`
  1. pygatt.exceptions.BLEError: No characteristic found matching 273e0003-4c4d-454d-96be-f03bac821358 (Linux)
  • There is a problem with the most recent version of pygatt. Work around this by downgrading to 3.1.1: pip install pygatt==3.1.1
  1. pygatt.exceptions.BLEError: No BLE adapter found (Linux)
  • Make sure your computer's Bluetooth is turned on.
  1. pygatt.exceptions.BLEError: Unexpected error when scanning: Set scan parameters failed: Connection timed out (Linux)
  • This seems to be due to a OS-level Bluetooth crash. Try turning your computer's bluetooth off and on again
  1. 'RuntimeError: could not create stream outlet' (Linux)
  • This appears to be due to Linux-specific issues with the newest version of pylsl. Ensure that you have pylsl 1.10.5 installed in the environment in which you are trying to run Muse LSL
  • If this is preceded by Could not instantiate IPv4 stack: getrandom, it could be this issue which can be resolved by building liblsl with -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX (e.g. by editing standalone_compilation_linux.sh)

Citing muse-lsl

@misc{muse-lsl,
  author       = {Alexandre Barachant and
                  Dano Morrison and
                  Hubert Banville and
                  Jason Kowaleski and
                  Uri Shaked and
                  Sylvain Chevallier and
                  Juan Jesús Torre Tresols},
  title        = {muse-lsl},
  month        = may,
  year         = 2019,
  doi          = {10.5281/zenodo.3228861},
  url          = {https://doi.org/10.5281/zenodo.3228861}
}

Alexandre Barachant, Dano Morrison, Hubert Banville, Jason Kowaleski, Uri Shaked, Sylvain Chevallier, & Juan Jesús Torre Tresols. (2019, May 25). muse-lsl (Version v2.0.2). Zenodo. http://doi.org/10.5281/zenodo.3228861

Release files for muselsl 2.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muselsl 2.5.2
File Size Uploaded
muselsl-2.5.2.tar.gz 143.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for muselsl 2.5.2
File Interpreter ABI Platform
muselsl-2.5.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 188.7 kB

Release files / muselsl-2.5.2.tar.gz

Download URL muselsl-2.5.2.tar.gz
Size 143.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a90bc67fb7e6cf130c15ce2ced575733aba77a2f30e839d686a83746cb881774
BLAKE2b-256 checksum
How to use checksums
9868b2ac6360cc5c375ab43b5b1b20ffb0c0d6fb54eb365c47409a9fdeee9cfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / muselsl-2.5.2-py2.py3-none-any.whl

Download URL muselsl-2.5.2-py2.py3-none-any.whl
Size 44.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3581d77f7833f248178ac8e2b716a8f411768c8bc91824e6bf75299d2218d5ce
BLAKE2b-256 checksum
How to use checksums
c7a6f458189b81a378f6352def2151e377ba9fa65a9a1f80b214afd874ca4fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

2.5.3

2 release files

This release

2.5.2 This release

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

1 release file

2.1.0

2 release files

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

1 release file

1.0.1

1 release file

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page