Skip to main content

pylsl

publish workflow PyPI version

This is the Python interface to the Lab Streaming Layer (LSL). LSL is an overlay network for real-time exchange of time series between applications, most often used in research environments. LSL has clients for many other languages and platforms that are compatible with each other.

Let us know if you encounter any bugs (ideally using the issue tracker on the GitHub project).

Installation

Prerequisites

On all non-Windows platforms and for some Windows-Python combinations, you must first obtain a liblsl shared library. See the liblsl repo documentation for further details.

Get pylsl from PyPI

  • pip install pylsl

Get pylsl from source

This should only be necessary if you need to modify or debug pylsl.

  • Download the pylsl source: git clone https://github.com/labstreaminglayer/pylsl.git && cd pylsl
  • From the pylsl working directory, run pip install ..
    • Note: You can use pip install -e . to install while keeping the files in-place. This is convenient for developing pylsl.

Usage

See the examples in pylsl/examples. Note that these can be run directly from the commandline with (e.g.) python -m pylsl.examples.{name-of-example}.

You can get a list of the examples with python -c "import pylsl.examples; help(pylsl.examples)"

liblsl loading

pylsl will search for liblsl first at the filepath specified by an environment variable named PYLSL_LIB, then in the package directory (default location for Windows), then finally in normal system library folders.

If the shared object is not installed onto a standard search path (or it is but can't be found for some other bug), then we recommend that you copy it to the pylsl installed module path's lib subfolder. i.e. {path/to/env/}site-packages/pylsl/lib.

  • The site-packages/pylsl path will only exist after you install pylsl in your Pyton environment.
  • You may have to create the lib subfolder.
  • Use python -m site to find the "site-packages" path.
  • Use cp -L on platforms that use symlinks.

Alternatively, you can use an environment variable. Set the PYLSL_LIB environment variable to the location of the library or set LD_LIBRARY_PATH to the folder containing the library. For example,

  1. PYLSL_LIB=/usr/local/lib/liblsl.so python -m pylsl.examples.{name-of-example}, or
  2. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib python -m pylsl.examples.{name-of-example}

For maintainers

Continuous Integration

pylsl uses continuous integration and distribution. GitHub Actions will upload a new release to pypi whenever a Release is created in GitHub. Before creating the GitHub release, be sure to bump the version number in pylsl/version.py and consider updating the liblsl dependency in .github/workflows/publish-to-pypi.yml.

Linux Binaries Deprecated

We recently stopped building binary wheels for Linux. In practice, the manylinux dependencies were often incompatible with real systems.

Manual Distribution

  1. Manual way:
    1. rm -Rf build dist *.egg-info
    2. python setup.py sdist bdist_wheel
    3. Additional steps on Linux:
      • auditwheel repair dist/*.whl -w dist
      • rm dist/*-linux_x86_64.whl
    4. twine upload dist/*
  2. For conda
    1. build liblsl: conda build ../liblsl/
    2. conda build .

Known Issues with Multithreading on Linux

  • At least for some versions of pylsl, it has been reported that running on Linux one cannot call pylsl functions from a thread that is not the main thread. This has been reported to cause access violations, and can occur during pulling from an inlet, and also from accessing an inlets info structure in a thread.
  • Recent tests with mulithreading (especially when safeguarding library calls with locks) using Python 3.7.6. with pylsl 1.14 on Linux Mint 20 suggest that this issue is solved, or at least depends on your machine. See https://github.com/labstreaminglayer/pylsl/issues/29

Acknowledgments

Pylsl was primarily written by Christian Kothe while at Swartz Center for Computational Neuroscience, UCSD. The LSL project was funded by the Army Research Laboratory under Cooperative Agreement Number W911NF-10-2-0022 as well as through NINDS grant 3R01NS047293-06S1. pylsl is maintained primarily by Chadwick Boulay. Thanks for contributions, bug reports, and suggestions go to Bastian Venthur, David Medine, Clemens Brunner, and Matthew Grivich.

Metadata

Release files for pylsl 1.16.2

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

Built distributions (wheels)

Table of built distributions (wheels) for pylsl 1.16.2
File Interpreter ABI Platform
pylsl-1.16.2-py2.py3-none-win_amd64.whl Python 2, Python 3 none Windows x86-64 Details
pylsl-1.16.2-py2.py3-none-win32.whl Python 2, Python 3 none Windows x86-32 Details
pylsl-1.16.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 673.4 kB

Release files / pylsl-1.16.2-py2.py3-none-win_amd64.whl

Download URL pylsl-1.16.2-py2.py3-none-win_amd64.whl
Size 353.6 kB
Tags Python 2 Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
827c7b75952a83aadbd6df8dd04adff6853a75c43c17b355370153cdb7c77d9f
BLAKE2b-256 checksum
How to use checksums
c5cc1f0e240ffca3c993b9e817ace77b37d5f60e7a17c09788ab58b1b91d82ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / pylsl-1.16.2-py2.py3-none-win32.whl

Download URL pylsl-1.16.2-py2.py3-none-win32.whl
Size 283.5 kB
Tags Python 2 Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
6138b0856e8653bbad6bfd043a62315fffbd6e21528ee905d1f989dbb7299322
BLAKE2b-256 checksum
How to use checksums
675917f0b884a4ce873360bd3f694ae66ba72da410d250c006afa35452648f6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / pylsl-1.16.2-py2.py3-none-any.whl

Download URL pylsl-1.16.2-py2.py3-none-any.whl
Size 36.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c7ebf9e0d96fe6c18bd4966dc734060900fabadd3cf30f652b256db732add5d7
BLAKE2b-256 checksum
How to use checksums
12856fa5adfebde09524836fb8dbc1d9a35f990e2048708a426dc31d0603983b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

1.18.5

6 release files

1.18.4

6 release files

1.18.2

6 release files

1.18.1

6 release files

1.18.0

2 release files

1.17.6

4 release files

1.17.5

4 release files

1.17.4

4 release files

1.17.3

2 release files

1.17.2

2 release files

1.17.1

2 release files

1.17.0

2 release files

This release

1.16.2 This release

3 release files

1.16.1

3 release files

1.16.0

5 release files

1.15.0

4 release files

1.14.0

4 release files

1.13.6

4 release files

1.13.5

5 release files

1.13.4

5 release files

1.13.3

5 release files

1.13.2

5 release files

1.12.2

2 release files

1.10.5

1 release file

1.10.3

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