Dylib error when trying to script muse-io



We have two MUSE headsets in the lab and if I try to run a script that calls two instances of muse-io, I get the following output:

dyld: Library not loaded: /usr/local/lib/liblo.7.dylib
Referenced from: /Applications/Muse/muse-io
Reason: image not found
./run: line 3: 18425 Trace/BPT trap: 5 muse-io --device […]

If I run each command in the command line it works just fine. This happens when I try either a shell script or through Apple’s automator, same result.

Here’s the otool output:

$ otool -L which muse-io
/usr/local/lib/liblo.7.dylib (compatibility version 10.0.0, current version 10.0.0)
/Users/narek/Dev/3rdparty/lsl/build/LSL/liblsl/src/liblsl.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1151.16.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1151.16.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Any help to resolve this issue would be most welcome.


When the research tools are installed, two lines are added to the .bashrc file, the default shell for terminal:
export PATH="$PATH:/Applications/Muse"

If your script is using a different shell (tcsh, csh, zsh, etc.) the .bashrc file will not be loaded and muse-io may not be able to locate liblo.7.dylib.

If you add similar lines to your script (or .rc file for the appropriate shell) that should fix the problem.


cbillard, thanks a lot!

Your suggestion worked great. I solved it by adding the correct environment variables in my “muse-io” script rather than change my environment.