Mopydy Spotify connect not installing

I have successfully installed ASLS and now my C4 is connected via USB to Rotel A12, play nicely Hurray.

So I went to install Mopydy, went OK. I tried mopydy extension Spotify and is does not working, maybe I should posted it on Github mopydy ?

dietpi@C4NAS:~$ sudo python3 -m pip install Mopidy-Spotify
Collecting Mopidy-Spotify
  Downloading Mopidy_Spotify-4.1.1-py3-none-any.whl (31 kB)
Requirement already satisfied: Mopidy>=3.0.0 in /usr/lib/python3/dist-packages (from Mopidy-Spotify) (3.3.0)
Requirement already satisfied: Pykka>=2.0.1 in /usr/lib/python3/dist-packages (from Mopidy-Spotify) (2.0.3)
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/dist-packages (from Mopidy-Spotify) (65.4.0)
Requirement already satisfied: requests>=2.20.0 in /usr/lib/python3/dist-packages (from Mopidy-Spotify) (2.25.1)
Collecting pyspotify>=2.0.5
  Downloading pyspotify-2.1.4.tar.gz (157 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.1/157.1 kB 2.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.9/dist-packages (from pyspotify>=2.0.5->Mopidy-Spotify) (1.15.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/dist-packages (from cffi>=1.0.0->pyspotify>=2.0.5->Mopidy-Spotify) (2.21)
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
  ╰─> [63 lines of output]
      /usr/local/lib/python3.9/dist-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/version.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/utils.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/user.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/track.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/toplist.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/social.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/sink.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/session.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/search.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/playlist_unseen_tracks.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/playlist_track.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/playlist_container.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/playlist.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/player.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/offline.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/link.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/inbox.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/image.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/eventloop.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/error.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/connection.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/config.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/compat.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/audio.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/artist.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/album.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/_spotify_build.py -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/__init__.py -> build/lib.linux-aarch64-cpython-39/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 '.circleci'
      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'
      writing manifest file 'pyspotify.egg-info/SOURCES.txt'
      copying spotify/api.h -> build/lib.linux-aarch64-cpython-39/spotify
      copying spotify/api.processed.h -> build/lib.linux-aarch64-cpython-39/spotify
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-cpython-39/spotify._spotify.c'
      creating build/temp.linux-aarch64-cpython-39
      building 'spotify._spotify' extension
      creating build/temp.linux-aarch64-cpython-39/build
      creating build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39
      aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.9 -c build/temp.linux-aarch64-cpython-39/spotify._spotify.c -o build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39/spotify._spotify.o
      build/temp.linux-aarch64-cpython-39/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

You are missing some dependency to be able to install your software

Following sounds similar to yours.

Oh yeah that is probablyt it.

However is that correct?

sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list

Dietpi is buster or bullseye already?

DietPi is not directly connected to a Debian release. Actually we support Buster, Bullseye and Bookworm.

Anyway, you could try it to have the library installed this way.

It worked but I had to remove mopydy and install according to Mopydy doc.