mopidy / mopidy-spotify

Mopidy extension for playing music from Spotify
https://mopidy.com/ext/spotify/
Apache License 2.0
933 stars 109 forks source link

Failed building pinwheel for pyspotify #283

Closed jd1103 closed 4 years ago

jd1103 commented 4 years ago

Hello, I am trying to install this extension using sudo python3 -m pip install Mopidy-Spotify

I am getting the following error messages.

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting Mopidy-Spotify
  Using cached https://files.pythonhosted.org/packages/1c/41/1d5b1b6534cf5ad209ba8b814132cfdadf8dcda87024beabb42c1f88ce22/Mopidy_Spotify-4.0.1-py3-none-any.whl
Requirement already satisfied: Pykka>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from Mopidy-Spotify) (2.0.2)
Collecting pyspotify>=2.0.5 (from Mopidy-Spotify)
  Using cached https://files.pythonhosted.org/packages/fe/1d/83d088397d95eacf6281ae748886d024aab50efdea50aedf8f294fc53aa7/pyspotify-2.1.3.tar.gz
  Installing build dependencies ... done
Requirement already satisfied: Mopidy>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from Mopidy-Spotify) (3.0.2)
Requirement already satisfied: requests>=2.20.0 in /usr/lib/python3/dist-packages (from Mopidy-Spotify) (2.21.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from Mopidy-Spotify) (40.8.0)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from pyspotify>=2.0.5->Mopidy-Spotify) (1.14.3)
Requirement already satisfied: tornado>=4.4 in /usr/local/lib/python3.7/dist-packages (from Mopidy>=3.0.0->Mopidy-Spotify) (6.0.4)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.0.0->pyspotify>=2.0.5->Mopidy-Spotify) (2.20)
Building wheels for collected packages: pyspotify
  Running setup.py bdist_wheel for pyspotify ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ajjcaroj/pyspotify/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-n1a7eam8 --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.7
  creating build/lib.linux-armv7l-3.7/spotify
  copying spotify/playlist_track.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/player.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/sink.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/playlist.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/session.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/artist.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/user.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/connection.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/_spotify_build.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/audio.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/__init__.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/album.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/utils.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/link.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/playlist_container.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/config.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/offline.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/image.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/track.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/search.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/compat.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/version.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/toplist.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/playlist_unseen_tracks.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/social.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/error.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/inbox.py -> build/lib.linux-armv7l-3.7/spotify
  copying spotify/eventloop.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:569: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-ajjcaroj/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-vo7v8435/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/playlist_track.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/player.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/sink.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/playlist.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/session.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/artist.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/user.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/connection.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/_spotify_build.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/audio.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/__init__.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/album.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/utils.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/link.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/playlist_container.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/config.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/offline.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/image.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/track.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/search.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/compat.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/version.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/toplist.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/playlist_unseen_tracks.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/social.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/error.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/inbox.py -> build/lib.linux-armv7l-3.7/spotify
    copying spotify/eventloop.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:569: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-ajjcaroj/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-vo7v8435/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ajjcaroj/pyspotify/
jodal commented 4 years ago

Thanks for including borth command and full output!

The important part of the error message is that the file libspotify/api.h is not found:

build/temp.linux-armv7l-3.7/spotify._spotify.c:569:10: fatal error: libspotify/api.h: No such file or directory

The pyspotify Python library depends on the libspotify C library. You need to install that before you can install pyspotify.

Please refer to https://github.com/mopidy/mopidy-spotify#dependencies for details on the required dependencies.

jd1103 commented 4 years ago

I ended up completely reinstalling Mopidy and all dependencies and was able to get myself connected. Thanks for your help!