Mopidy-Spotify failing to install - Raspbian

Getting the following when running. Cannot install the extension.

sudo python3 -m pip install Mopidy-Spotify

creating build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c build/temp.linux-armv7l-3.7/spotify._spotify.c -o build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7/spotify._spotify.o
build/temp.linux-armv7l-3.7/spotify._spotify.c:540:10: fatal error: libspotify/api.h: No such file or directory
#include “libspotify/api.h”
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1


Failed building wheel for pyspotify
Running setup.py clean for pyspotify
Failed to build pyspotify
Installing collected packages: pyspotify, Mopidy-Spotify
Running setup.py install for pyspotify … error
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-ac163g70/pyspotify/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-26a6n2lj/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.7
creating build/lib.linux-armv7l-3.7/spotify
copying spotify/_spotify_build.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/sink.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/search.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/player.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/user.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/toplist.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/version.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/track.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/audio.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/album.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/init.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/artist.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/playlist_container.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/offline.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/error.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/playlist.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/utils.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/playlist_track.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/connection.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/eventloop.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/config.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/playlist_unseen_tracks.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/link.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/inbox.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/social.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/session.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/image.py -> build/lib.linux-armv7l-3.7/spotify
copying spotify/compat.py -> build/lib.linux-armv7l-3.7/spotify
running egg_info
writing pyspotify.egg-info/PKG-INFO
writing dependency_links to pyspotify.egg-info/dependency_links.txt
writing requirements to pyspotify.egg-info/requires.txt
writing top-level names to pyspotify.egg-info/top_level.txt
reading manifest file ‘pyspotify.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘’ under directory ‘.github’
no previously-included directories found matching ‘docs/_build’
no previously-included directories found matching ‘examples/tmp’
warning: no previously-included files matching 'pycache/
’ found anywhere in distribution
writing manifest file ‘pyspotify.egg-info/SOURCES.txt’
copying spotify/api.h -> build/lib.linux-armv7l-3.7/spotify
copying spotify/api.processed.h -> build/lib.linux-armv7l-3.7/spotify
running build_ext
generating cffi module ‘build/temp.linux-armv7l-3.7/spotify._spotify.c’
creating build/temp.linux-armv7l-3.7
building ‘spotify._spotify’ extension
creating build/temp.linux-armv7l-3.7/build
creating build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c build/temp.linux-armv7l-3.7/spotify._spotify.c -o build/temp.linux-armv7l-3.7/build/temp.linux-armv7l-3.7/spotify._spotify.o
build/temp.linux-armv7l-3.7/spotify._spotify.c:540:10: fatal error: libspotify/api.h: No such file or directory
#include “libspotify/api.h”
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1

----------------------------------------

Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-ac163g70/pyspotify/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-26a6n2lj/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-ac163g70/pyspotify/

Did you install the extensions dependencies? libspotify appears to be missing, at least.

It is easier to install Mopidy-Spotify using sudo apt install mopidy-spotify. Ensure you have first followed the instructions at apt.mopidy.com on how to setup Mopidy’s APT repo on your system.

Worked a treat. Thanks for pointing me to the right place.