由于gcc失败,无法为python安装PySpotify模块

时间:2013-06-23 21:40:15

标签: python command spotify libspotify

我一直在尝试安装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

1 个答案:

答案 0 :(得分:2)

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

是您问题的根源。仅仅拥有DLL是不够的,标题也需要可用。

https://github.com/mopidy/pyspotify/issues/63涵盖了类似的问题,可能会提供一些有关如何解决此问题的提示。