Error installing mopidy spotify extension

When I trying to install this extension, I get this error:

Building wheels for collected packages: pyspotify
  Building wheel for pyspotify (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyspotify (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      running bdist_wheel
      running build
      running build_py
      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
      adding license file 'LICENSE'
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-3.9/spotify._spotify.c'
      building 'spotify._spotify' extension
      error: command 'aarch64-linux-gnu-gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyspotify
Failed to build pyspotify
ERROR: Could not build wheels for pyspotify, which is required to install pyproject.toml-based projects

I am installing it on a Odroid HC4 with bullseye version
Thank you.

You are missing the compiler

error: command 'aarch64-linux-gnu-gcc' failed: No such file or directory

Try to install Build Essential from our software catalogue and try again.

Keep getting an error

Building wheels for collected packages: pyspotify
  Building wheel for pyspotify (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyspotify (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      running bdist_wheel
      running build
      running build_py
      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
      adding license file 'LICENSE'
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-3.9/spotify._spotify.c'
      building 'spotify._spotify' extension
      build/temp.linux-aarch64-3.9/spotify._spotify.c:569:10: fatal error: libspotify/api.h: No such file or directory
        569 | #include "libspotify/api.h"
            |          ^~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyspotify
Failed to build pyspotify
ERROR: Could not build wheels for pyspotify, which is required to install pyproject.toml-based projects

did you tried to use a search engine on your errors? Because I’m doing noting else.

fatal error: libspotify/api.h: No such file or directory

https://github.com/jodal/pyspotify/issues/163#issuecomment-107188940

Sorry I thought it was something related with dietpi. That’s what Dietpi is, some automated software, to make things easy…

Sorry, I will search the solution…

but you are trying to install some software that is not part of our catalogue. I mean, you are doing it manually, Isn’t it? You are not using dietpi-software?

What?

Well I install mopidy through dietpi-software, and when adding an extension for that software I get the error…

how do you add this extension? Any guide you are following?

The one on your documentation for installing extension on Mopidy:

Adding Mopidy extensions

Mopidy is highly customisable and supports various extensions from alternative web clients to backend extensions. See Extensions for a list.

Those can be installed via pip, e.g.:

pip3 install --no-cache-dir -U Mopidy-Jellyfin

and what is the command you used? Which extension you are trying to install?

Our docs showing an example only. There could be differences depending on your extentsion.

The one for spotify.

I use

pip3 install --no-cache-dir -U Mopidy-Spotify

ok for this you need to install correct dependency as stated on their docs https://pyspotify.readthedocs.io/en/latest/installation/#debian-ubuntu

sudo apt-get install libspotify-dev

and build tools https://pyspotify.readthedocs.io/en/latest/installation/#build-tools

Build tools you already installed from our catalogue.

You are fine to retry, if you have both condition fulfilled



root@DietPi:~# sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list
root@DietPi:~# apt-get update
Hit:1 https://downloads.plex.tv/repo/deb public InRelease
Hit:2 https://deb.debian.org/debian bullseye InRelease                         
Hit:3 https://deb.debian.org/debian bullseye-updates InRelease                 
Hit:4 https://deb.debian.org/debian-security bullseye-security InRelease       
Hit:5 https://deb.debian.org/debian bullseye-backports InRelease               
Hit:6 https://apt.mopidy.com buster InRelease                                  
Hit:7 https://dietpi.com/meveric bullseye InRelease                            
Hit:8 https://dietpi.com/meveric all InRelease                              
Ign:9 https://download.webmin.com/download/repository sarge InRelease
Hit:10 https://download.webmin.com/download/repository sarge Release
Reading package lists... Done
root@DietPi:~# sudo apt-get install libspotify-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libspotify-dev

Hi Joulinar, I am getting “unable to locate package”, I find that, that apt archive is build for buster, but on github the dev say is compatible…

Is there anything I could do?

Thank you.

EDIT: Or is because of this… libspotify not available for arm64 architecture · Issue #304 · mopidy/mopidy-spotify · GitHub

looks like they support 32bit only on RPi https://docs.mopidy.com/en/latest/installation/debian/#distribution-and-architecture-support