【问题标题】:Building python app for creating Spotify playlists构建用于创建 Spotify 播放列表的 python 应用程序
【发布时间】:2013-10-14 19:43:27
【问题描述】:

我正在尝试构建一个基于输入字符串创建 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 文件与libspotify 文件夹和应用程序密钥一起位于pyspotify 文件夹中。我需要做什么才能安装 pyspotify?

感谢您的帮助!

/埃里克

【问题讨论】:

    标签: python spotify


    【解决方案1】:

    该错误是由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 存储库并从中手动安装。如果你真的想拥有最新的开发版本(目前 v1.11 和 git 版本之间几乎没有区别),你可以使用以下方式安装它:

    pip install pyspotify==dev
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-08
      • 1970-01-01
      • 2012-06-05
      • 2017-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多