mopidy / homebrew-mopidy

Homebrew formulas for Mopidy and Mopidy extensions
https://mopidy.com
Other
22 stars 15 forks source link

Extension spotify failed during setup: Library not loaded: @loader_path/../Frameworks/libspotify.framework/libspotify #16

Closed simmel closed 4 years ago

simmel commented 7 years ago

Hi! I've reinstalled my work laptop to 10.12.3 and thus I had to install mopidy via the homebrew tap again.

I can't get Spotify to work correctly, looks like it's framework is incorrectly linked?

$ mopidy
INFO     Starting Mopidy 2.1.0
INFO     Loading config from builtin defaults
INFO     Loading config from /Users/simlu/.config/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: spotify, mpd, http, stream, m3u, scrobbler, softwaremixer, file, local
INFO     Disabled extensions: none
ERROR    Extension spotify failed during setup, this might have left the registry in a bad state.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/mopidy/__main__.py", line 121, in main
    extension.setup(registry)
  File "/usr/local/lib/python2.7/site-packages/mopidy_spotify/__init__.py", line 49, in setup
    from mopidy_spotify.backend import SpotifyBackend
  File "/usr/local/lib/python2.7/site-packages/mopidy_spotify/backend.py", line 11, in <module>
    import spotify
  File "/usr/local/lib/python2.7/site-packages/spotify/__init__.py", line 81, in <module>
    from spotify._spotify import ffi, lib  # noqa
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/spotify/_spotify.so, 2): Library not loaded: @loader_path/../Frameworks/libspotify.framework/libspotify
  Referenced from: /usr/local/lib/python2.7/site-packages/spotify/_spotify.so
  Reason: image not found
INFO     Starting Mopidy mixer: SoftwareMixer
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend
[…]

Thanks!

simmel commented 7 years ago

I found http://stackoverflow.com/questions/16826922/what-path-does-loader-path-resolve-to which links to http://stackoverflow.com/questions/1937232/linking-to-a-dynamic-library-on-a-mac-with-full-path and ran:

$ sudo install_name_tool -change @loader_path/../Frameworks/libspotify.framework/libspotify /usr/local/lib/libspotify /usr/local/lib/python2.7/site-packages/spotify/_spotify.so

which made mopidy-spotify work again. So I'm guessing it's linked wrong during the build?

jodal commented 4 years ago

The formulas in this tap have now been updated to run on Python 3. libspotify isn't built, just unpackaged from the binaries provided by Spotify years ago. pyspotify is built, now only on Python 3, and comes with the latest versions of cffi and pycparser. Hopefully, this is no longer a problem.