chkothe / pylsl

Python interface to the Lab Streaming Layer
MIT License
68 stars 21 forks source link

Cannot import on Raspberry Pi #1

Open jona-sassenhagen opened 7 years ago

jona-sassenhagen commented 7 years ago

On my Raspberry Pi, importing pylsl fails:

Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylsl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/pylsl/__init__.py", line 2, in <module>
    from .pylsl import IRREGULAR_RATE, DEDUCED_TIMESTAMP, FOREVER, cf_float32,\
  File "/usr/local/lib/python3.4/dist-packages/pylsl/pylsl.py", line 1147, in <module>
    lib = CDLL(libpath)
  File "/usr/lib/python3.4/ctypes/__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so: cannot open shared object file: No such file or directory

Of course, /usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so exists.

Any suggestions?

jona-sassenhagen commented 7 years ago

Hm ...

file /usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so
/usr/local/lib/python3.4/dist-packages/pylsl/liblsl32.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=705a572a6241fc39cecd87aaeb29fb36ea6a9d5d, not stripped

Is it possible this problem comes from the library being compiled for 386 when I'm running ARM ..?

jona-sassenhagen commented 7 years ago

The issue is indeed that liblsl32 needs to be compiled for ARM. Recompiling for ARM fixes this.

cboulay commented 2 years ago

For people coming to this in the future, please note that this repo should be archived. Please use https://github.com/labstreaminglayer/liblsl-Python instead.

For Raspberry Pi, one of the issues with older pylsl was that it shipped with a bunch of binaries but they only worked on some platforms. This version of pylsl was packaged on pypi as a "source only" distribution. The RPi package index of course didn't know this included binaries so it was happy to take it, even if the binaries were incorrect.

Then we updated pylsl to ship more binaries, including some manylinux and some arm, and got rid of the source-only version. But the RPi package index doesn't pull ARM-tagged wheels from pypi, so it was stuck on the old version.

More recently we are shipping binaries only for Windows and some Macs, and the rest of the platforms get a source-only version but they have to install their own binaries. When the binaries are missing there is now a more informative error message that describes this. Accessing liblsl binaries is made easier with .deb files and conda distributions, but there's also a script at the root of the liblsl repo that works on most linux platforms that don't have available binaries.