RNBO Pi Example: "ImportError: No module named liblo"

DO's icon

I'm trying to follow the LDR tutorial and should have everything setup correctly, except when trying to run the Python script it can't seem to find liblo. pyliblo3 is definitely installed (when trying to install again, I get "requirement already satisfied: pyliblo3 in ./.local/lib/python3.9/site-packages (0.13.0)"), but when running the script I get:

Traceback (most recent call last):
File "RNBOPi_LDR.py", line 2, in <module>
import liblo as OSC
ImportError: No module named liblo

I'm probably missing something obvious, but would appreciate any help in troubleshooting.

Jan M's icon

Hello DO,

under which user is you script running? have you tried to run is as sudo? maybe it's a permission issue...

Jan M's icon

another thing could be, if you are executing your script not from command line but an IDE like Thonny or PyCharm the IDE might create their own virtual python environment and the liblo package has to be installed or linked there as well.

DO's icon

Hi Jan, thank you for the leads. I am trying to run it in the command line as the admin account (so same error when trying as sudo).

Jan M's icon

I am not in front of a computer right now, so unfortunately I can't check other things. I had trouble installing liblo on my dev machine (macOS) but on the raspberry all when well so far. I guess you already tried to purge and reinstall liblo, maybe something when wrong during installation....

@cycling74: it would be a nice detail to ship the next RNBO/RasPi bistro with liblo already on board. There are probably many of us who are using python scripts to interact with the runner.

Jan M's icon

Today I tried to install pyliblo3 on a new RaspPi and after a long time fiddling around I gave up.It seems definitely broken. I switched to another python OSC library that seems to work fine.