python - 如何在 Mac OSX Lion 上安装 libspotify?

标签 python macos osx-lion spotify homebrew

我正在尝试在 Mac OSX Lion 上安装 libspotify。我想在 Python 脚本中使用 spotify api。当我尝试安装 pyspotify 时,它说:

running install
running bdist_egg
running egg_info
writing pyspotify.egg-info/PKG-INFO
writing top-level names to pyspotify.egg-info/top_level.txt
writing dependency_links to pyspotify.egg-info/dependency_links.txt
reading manifest file 'pyspotify.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyspotify.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.8-intel/egg
running install_lib
running build_py
running build_ext
building 'spotify._spotify' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Isrc -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/module.c -o build/temp.macosx-10.8-intel-2.7/src/module.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
src/module.c:20:10: fatal error: 'spotify/api.h' file not found
#include "spotify/api.h"
         ^
1 error generated.
error: command 'clang' failed with exit status 1

我尝试使用 brew 安装 libspotify...

brew install libspotify

最佳答案

要么像你说的那样用 brew 安装它,要么只是将 libspotify.framework 复制到/Library/Frameworks

现在您应该能够像这样包含库了:

#include <libspotify/api.h>

关于python - 如何在 Mac OSX Lion 上安装 libspotify?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11917568/

相关文章:

python - 关于代码段的时间复杂度

python - Selenium 无法通过类名找到元素

python - python中的快速数据比较

MacOS:NSPredicate 查找 "one to one"关系不为零的地方

php - 在 mac os x 上创建 mysql 数据库

python - 找不到满足 urllib 要求的版本

cocoa - 如何使用 NSTrackingArea

macos - 有没有办法在 MAC 上从 OpenSSH_5.6p1 更新到 OpenSSH 5.9?

mysql - MAMP -- MySQL 服务器 -- LION 问题

mount - 如何在10.7中安装vmdk?