0

我一直在尝试安装 pySpotify 模块。我已经安装了 libspotify 并将 libspotify.dll 文件夹添加到路径中。当我尝试安装 pyspotify 作为下一步时,我收到以下错误消息。有任何想法吗?

我在 Windows 7 上使用 python 2.7.5

C:\Users\paulmiles\Documents\GitHub\pyspotify>python setup.py install
running install
running build
running build_py
running build_ext
building 'spotify._spotify' extension
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Isrc -IC:\PYTHON27\include -IC:
\PYTHON27\PC -c src/module.c -o build\temp.win32-2.7\Release\src\module.o
src/module.c:3:28: error: libspotify/api.h: No such file or directory
In file included from src/module.c:4:
src/pyspotify.h:47: error: expected ')' before 'error'
src/pyspotify.h:48: error: expected ')' before 'error'
In file included from src/module.c:5:
src/artist.h:3: error: expected specifier-qualifier-list before 'sp_artist'
src/artist.h:11: error: expected ')' before '*' token
In file included from src/module.c:6:
src/artistbrowser.h:5: error: expected specifier-qualifier-list before 'sp_artis
tbrowse'
src/artistbrowser.h:13: error: expected ')' before '*' token
In file included from src/module.c:7:
src/album.h:3: error: expected specifier-qualifier-list before 'sp_album'
src/album.h:11: error: expected ')' before '*' token
In file included from src/module.c:8:
src/albumbrowser.h:5: error: expected specifier-qualifier-list before 'sp_albumb
rowse'
src/albumbrowser.h:13: error: expected ')' before '*' token
In file included from src/module.c:9:
src/link.h:3: error: expected specifier-qualifier-list before 'sp_link'
In file included from src/module.c:10:
src/playlist.h:6: error: expected specifier-qualifier-list before 'sp_playlist'
src/playlist.h:15: error: expected specifier-qualifier-list before 'sp_playlist_
callbacks'
src/playlist.h:22: error: expected specifier-qualifier-list before 'sp_playlist'

src/playlist.h:28: error: expected ')' before '*' token
In file included from src/module.c:11:
src/playlistcontainer.h:6: error: expected specifier-qualifier-list before 'sp_p
laylistcontainer'
src/playlistcontainer.h:11: error: expected specifier-qualifier-list before 'sp_
playlistcontainer_callbacks'
src/playlistcontainer.h:18: error: expected specifier-qualifier-list before 'sp_
playlistcontainer'
src/playlistcontainer.h:29: error: expected ')' before '*' token
In file included from src/module.c:12:
src/playlistfolder.h:7: error: expected specifier-qualifier-list before 'sp_uint
64'
src/playlistfolder.h:18: error: expected ')' before '*' token
In file included from src/module.c:13:
src/search.h:3: error: expected specifier-qualifier-list before 'sp_search'
src/search.h:11: error: expected ')' before '*' token
In file included from src/module.c:14:
src/session.h:3: error: expected specifier-qualifier-list before 'sp_session'
src/session.h:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'*' token
src/session.h:12: error: expected ')' before 'error'
src/session.h:15: error: expected ')' before '*' token
In file included from src/module.c:15:
src/toplistbrowser.h:3: error: expected specifier-qualifier-list before 'sp_topl
istbrowse'
src/toplistbrowser.h:11: error: expected ')' before '*' token
In file included from src/module.c:16:
src/track.h:3: error: expected specifier-qualifier-list before 'sp_track'
src/track.h:11: error: expected ')' before '*' token
In file included from src/module.c:17:
src/image.h:3: error: expected specifier-qualifier-list before 'sp_image'
src/image.h:11: error: expected ')' before '*' token
In file included from src/module.c:18:
src/user.h:3: error: expected specifier-qualifier-list before 'sp_user'
src/user.h:11: error: expected ')' before '*' token
src/module.c: In function 'init_spotify':
src/module.c:63: error: 'SPOTIFY_API_VERSION' undeclared (first use in this func
tion)
src/module.c:63: error: (Each undeclared identifier is reported only once
src/module.c:63: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1
4

1 回答 1

2
src/module.c:3:28: error: libspotify/api.h: No such file or directory

是你问题的根源。仅仅拥有 DLL 是不够的,头文件也需要可用。

https://github.com/mopidy/pyspotify/issues/63涵盖了一个类似的问题,并且可能会提供一些关于如何为 Windows 修复此问题的提示。

于 2013-06-24T11:14:56.960 回答