Package: pylsl
pylslThis is the Python interface to theLab 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).InstallationPrerequisitesOn all non-Windows platforms and for some Windows-Python combinations, you must first obtain a liblsl shared library. See theliblsl repo documentationfor further details.Get pylsl from PyPIpip install pylslGet pylsl from sourceThis 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 pylslFrom thepylslworking directory, runpip install ..Note: You can usepip install -e .to install while keeping the files in-place. This is convenient for developing pylsl.UsageSee 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 withpython -c "import pylsl.examples; help(pylsl.examples)"liblsl loadingpylslwill search forliblslfirst at the filepath specified by an environment variable namedPYLSL_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 someother bug), then we recommend that you copy it to the pylsl installed module path'slibsubfolder. i.e.{path/to/env/}site-packages/pylsl/lib.Thesite-packages/pylslpath will only existafteryou installpylslin your Pyton environment.You may have to create thelibsubfolder.Usepython -m siteto find the "site-packages" path.Usecp -Lon platforms that use symlinks.Alternatively, you can use an environment variable. Set thePYLSL_LIBenvironment variable to the location of the library or setLD_LIBRARY_PATHto the folder containing the library. For example,PYLSL_LIB=/usr/local/lib/liblsl.so python -m pylsl.examples.{name-of-example}, orLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib python -m pylsl.examples.{name-of-example}For maintainersContinuous Integrationpylsl 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 inpylsl/version.pyand consider updating the liblsl dependency
in.github/workflows/publish-to-pypi.yml.Linux Binaries DeprecatedWe recently stopped building binary wheels for Linux. In practice, themanylinuxdependencies were often incompatible with real systems.Manual DistributionManual way:rm -Rf build dist *.egg-infopython setup.py sdist bdist_wheelAdditional steps on Linux:auditwheel repair dist/*.whl -w distrm dist/*-linux_x86_64.whltwine upload dist/*For condabuild liblsl:conda build ../liblsl/conda build .Known Issues with Multithreading on LinuxAt least for some versions of pylsl, it has been reported that running on Linux one cannot callpylslfunctions 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. Seehttps://github.com/labstreaminglayer/pylsl/issues/29AcknowledgmentsPylsl 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.