PySpotify not working on Raspberry Pi 4 (arm64 architecture)

I have successfully installed Mopidy from PyPI on a Raspberry Pi 4 running Ubuntu 19.10

The Soundcloud and Musicbox player extensions are working fine, however the Mopidy-Spotify extension isn’t installing properly:

sudo python3 -m pip install Mopidy-Spotify triggers the following error:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-yn5ysv3r/pyspotify/

I then did sudo apt install build-essential python-dev python3-dev libffi-dev
and then tried pip install pyspotify

Which gave me this

build/temp.linux-aarch64-2.7/spotify._spotify.c:540:10: fatal error: libspotify/api.h: No such file or directory
      540 | #include "libspotify/api.h"
          |          ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

I am guessing the issue has to do with libspotify not supporting arm64 architectures


If this is so, are there any ways around this for making Spotify work with Mopidy using the described setup?

Any word on this? I might need to resort to librespot :frowning:

There’s no work around. Spotify never released a 64bit version of libspotify for arm so we can not do anything about this. If you want Spotify playback on arm64 you need to use something else.

1 Like

I recommend to try regular Raspbian. I read somewhere that they still have a 32bit system for compatibility reasons. The RasPi 3 already used a 64 bit CPU, but I think with Rasbian everything worked fine.

1 Like

I suppose it’s worth a shot! Despite not using the rpi4 to its full potential, if my goal is to have a fully-functioning mopidy music player setup then I’ll have to consider this switch. Thanks for the tip.

Unless you have a specific reason to want to use Ubuntu on the Raspberry Pi, you’ll be much better off with Raspbian. And yes, Raspbian is 32bit.

1 Like

thanks for the advice!

Reinforcing what kingosticks is saying, until there’s an 8 GB Pi 4 (which I’d buy in a second!), there’s no compelling reason for a 64 bit OS. 32 bits can address all of the memory a 4 GB Pi 4 has. I’d love the whole system to move toward a 64 bit OS, but I don’t really see the point of the overhead of 64 bit code on a 4 GB address space.

That’s not to day that I don’t toy with 64 bit OSs on my Pi 4, I’m just not sure where the pay off is today.

@KraigoMpls @kingosticks @bluepuma77 I ended up using a 32 bit version of ubuntu as recommended in the docs… Took track of the process and shared here for other noobs like me: https://gist.github.com/maphouse/5468da4b6a086ac696e83aae31bec7e7 !

Thanks for all the help, I have my music player all set up now :slight_smile: