python
  • github
  • pip
  • 2016-04-11 26 views 0 likes 
    0

    後命令PIP安裝Spotify的,鬆土時錯誤代碼一個試圖安裝Python模塊

    Command "/Users/ink/.pyenv/versions/2.7.10/bin/python2.7 -u -c "import  
    setuptools, 
    tokenize;__file__='/private/var/folders/x4/6m1qwdmx7x9_qsbwv4zsny6w0000gn/T 
    /pip-build-oQ_7kB/cffi/setup.py';exec(compile(getattr(tokenize, 'open',  
    open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
    install --record /var/folders/x4/6m1qwdmx7x9_qsbwv4zsny6w0000gn/T/pip- 
    3YzrfM-record/install-record.txt --single-version-externally-managed -- 
    compile" failed with error code 1 in  
    /private/var/folders/x4/6m1qwdmx7x9_qsbwv4zsny6w0000gn/T/pip-build- 
    oQ_7kB/cffi/ 
    

    也這是非常重要的

    c/_cffi_backend.c:15:10: fatal error: 'ffi.h' file not found 
    #include <ffi.h> 
         ^
    1 error generated. 
    error: command 'clang' failed with exit status 1 
    
    +0

    檢查您是否已經安裝libffi和libffi-dev的。 – Xiflado

    +0

    你需要安裝開發頭文件http://stackoverflow.com/questions/12982486/glib-compile-error-ffi-h-but-libffi-is-installed –

    回答

    0

    這裏的問題是,libffi包含文件不能位於編譯器。

    看來您使用的是OSX。如果xcode已正確安裝,則應該包含文件/usr/include/ffi

    如果是這樣,請嘗試:

    CFLAGS=-I/usr/include/ffi pip install spotify-ripper 
    

    (如果使用的是macportshomebrew你會發現它更容易安裝他們的libffi版)

    +0

    仍然沒有工作。什麼是libffi?據我所知,xcode已經成功安裝。 編輯:從自制軟件安裝libffi,它的工作原理,謝謝! –

    相關問題