google-research/robopianist

OSError: undefined symbol ffi_type_uint32 when running make test after installing package from source

CBlagden opened this issue · 2 comments

When installing the package from source, running make test will result in the following error:

________________________________________________________________________________________________________ ERROR collecting test session ________________________________________________________________________________________________________
../anaconda3/envs/pianist/lib/python3.10/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../anaconda3/envs/pianist/lib/python3.10/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../anaconda3/envs/pianist/lib/python3.10/site-packages/_pytest/python.py:216: in pytest_collect_file
    module: Module = ihook.pytest_pycollect_makemodule(
../anaconda3/envs/pianist/lib/python3.10/site-packages/_pytest/config/compat.py:67: in fixed_hook
    return hook(**kw)
../anaconda3/envs/pianist/lib/python3.10/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
../anaconda3/envs/pianist/lib/python3.10/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/ros/foxy/lib/python3.8/site-packages/launch_testing/pytest/hooks.py:188: in pytest_pycollect_makemodule
    entrypoint = find_launch_test_entrypoint(path)
/opt/ros/foxy/lib/python3.8/site-packages/launch_testing/pytest/hooks.py:178: in find_launch_test_entrypoint
    module = import_path(path, root=None)
../anaconda3/envs/pianist/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path
    importlib.import_module(module_name)
../anaconda3/envs/pianist/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
robopianist/models/piano/__init__.py:15: in <module>
    from robopianist.models.piano.piano import Piano
robopianist/models/piano/piano.py:24: in <module>
    from robopianist.models.piano import midi_module, piano_mjcf
robopianist/models/piano/midi_module.py:23: in <module>
    from robopianist.music import midi_file, midi_message
robopianist/music/__init__.py:21: in <module>
    from robopianist.music import library, midi_file
robopianist/music/library.py:20: in <module>
    from note_seq.protobuf import music_pb2
../anaconda3/envs/pianist/lib/python3.10/site-packages/note_seq/__init__.py:22: in <module>
    from note_seq.chord_inference import ChordInferenceError
../anaconda3/envs/pianist/lib/python3.10/site-packages/note_seq/chord_inference.py:23: in <module>
    from note_seq import sequences_lib
../anaconda3/envs/pianist/lib/python3.10/site-packages/note_seq/sequences_lib.py:29: in <module>
    import pretty_midi
../anaconda3/envs/pianist/lib/python3.10/site-packages/pretty_midi/__init__.py:145: in <module>
    from .pretty_midi import *
../anaconda3/envs/pianist/lib/python3.10/site-packages/pretty_midi/pretty_midi.py:17: in <module>
    from .instrument import Instrument
../anaconda3/envs/pianist/lib/python3.10/site-packages/pretty_midi/instrument.py:6: in <module>
    import fluidsynth
../anaconda3/envs/pianist/lib/python3.10/site-packages/fluidsynth.py:48: in <module>
    _fl = CDLL(lib)
../anaconda3/envs/pianist/lib/python3.10/ctypes/__init__.py:374: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

This error seems to come from the pyfluidsynth package, because when it is installed alongside pretty_midi (which note_seq depends on) then import pretty_midi will give the above error.

Installing from pypi gives the same error.

This is all done on a python 3.10 conda environment with ubuntu 20.04.

Hi @CBlagden. I seemed to run into this issue as well on one of my machines.
Running export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7 before running robopianist resolved the issue for me (in my case i just added it to my .bashrc).

Thank you @wuphilipp it worked!