1

我正在尝试构建一个基于输入字符串创建 Spotify 播放列表的 Python 程序。我正在使用 pyspotify 包装器和 Spotify API(libspotify,包括许可证密钥)。要安装包含 libspotify 链接的 pyspotify 包装器,我克隆了 git 存储库(现在甚至不知道这个的含义,但我认为这就是我所做的),然后运行安装的 Xcode4,并加载命令行工具。然后运行: sudo python setup.py install 按照http://pyspotify.mopidy.com/en/latest/introduction/的说明进行安装。

但是,我收到错误消息:

clang: warning: argument unused during compilation: '-mno-fused-madd'
src/module.c:3:10: fatal error: 'libspotify/api.h' file not found
#include "libspotify/api.h"
     ^
1 error generated.
error: command 'clang' failed with exit status 1

api.h文件与文件夹和应用程序密钥pyspotify一起位于文件夹中。libspotify我需要做什么才能安装 pyspotify?

谢谢您的帮助!

/埃里克

4

1 回答 1

0

该错误是由于setup.py找不到您的libspotify安装引起的。

在安装 pyspotify 之前,您需要安装 libspotify。您可以:

  1. 从 Spotify 的网站下载 tarball,解压,更改为解压到的目录,然后运行:

    ./configure && make && sudo make install
    
  2. 或使用 Homebrew 通过运行安装它:

    brew install libspotify
    

安装 libspotify 后,您只需运行以下命令即可从 PyPI 安装 pyspotify:

pip install pyspotify

除非您计划在 pyspotify 本身上进行编码,否则无需检查 git repo 并从中手动安装。如果你真的想拥有最新的开发版本(目前 v1.11 和 git 版本之间几乎没有区别),你可以使用以下方式安装它:

pip install pyspotify==dev
于 2013-10-15T06:25:27.937 回答