2016-06-29 186 views
1

我試圖安裝quandl蟒蛇PIP安裝錯誤:命令「GCC」與退出狀態失敗1

pip install quandl 

但我得到了以下錯誤:

Collecting quandl 
    Using cached Quandl-3.0.1-py2.py3-none-any.whl 
    Collecting pyOpenSSL (from quandl) 
    Using cached pyOpenSSL-16.0.0-py2.py3-none-any.whl 
    Requirement already satisfied (use --upgrade to upgrade): pyasn1 in  /usr/local/lib/python3.2/dist-packages (from quandl) 
    Collecting more-itertools (from quandl) 
    Using cached more-itertools-2.2.tar.gz 
    Requirement already satisfied (use --upgrade to upgrade): six in ./.local/lib/python3.2/site-packages (from quandl) 
    Collecting ndg-httpsclient (from quandl) 
    Using cached ndg_httpsclient-0.4.1.tar.gz 
    Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8 in /usr/local/lib/python3.2/dist-packages (from quandl) 
    Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.local/lib/python3.2/site-packages (from quandl) 
    Requirement already satisfied (use --upgrade to upgrade): pandas>=0.14 in ./.local/lib/python3.2/site-packages (from quandl) 
    Collecting requests>=2.7.0 (from quandl) 
    Using cached requests-2.10.0-py2.py3-none-any.whl 
    Collecting inflection>=0.3.1 (from quandl) 
    Using cached inflection-0.3.1.tar.gz 
    Collecting cryptography>=1.3 (from pyOpenSSL->quandl) 
    Using cached cryptography-1.4.tar.gz 
    Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./.local/lib/python3.2/site-packages (from pandas>=0.14->quandl) 
    Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/local/lib/python3.2/dist-packages (from cryptography>=1.3->pyOpenSSL->quandl) 
    Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /usr/local/lib/python3.2/dist-packages (from cryptography>=1.3->pyOpenSSL->quandl) 
    Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python3.2/dist-packages (from cryptography>=1.3->pyOpenSSL->quandl) 
    Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/local/lib/python3.2/dist-packages (from cryptography>=1.3->pyOpenSSL->quandl) 
    Collecting cffi>=1.4.1 (from cryptography>=1.3->pyOpenSSL->quandl) 
    Using cached cffi-1.7.0.tar.gz 
    Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python3.2/dist-packages (from cffi>=1.4.1->cryptography>=1.3->pyOpenSSL->quandl) 
    Installing collected packages: cffi, cryptography, pyOpenSSL, more-itertools, ndg-httpsclient, requests, inflection, quandl 
    Running setup.py install for cffi 
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-svu9h7/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lo33rp-record/install-record.txt --single-version-externally-managed --compile: 
    Package libffi was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libffi.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libffi' found 
    Package libffi was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libffi.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libffi' found 
    Package libffi was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libffi.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libffi' found 
    Package libffi was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libffi.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libffi' found 
    Package libffi was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libffi.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libffi' found 
    running install 
    running build 
    running build_py 
    creating build 
    creating build/lib.linux-i686-3.2 
    creating build/lib.linux-i686-3.2/cffi 
    copying cffi/cparser.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/backend_ctypes.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/commontypes.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/vengine_cpy.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/verifier.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/cffi_opcode.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/model.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/api.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/setuptools_ext.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/lock.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/ffiplatform.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/__init__.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/vengine_gen.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/recompiler.py -> build/lib.linux-i686-3.2/cffi 
    copying cffi/_cffi_include.h -> build/lib.linux-i686-3.2/cffi 
    copying cffi/parse_c_type.h -> build/lib.linux-i686-3.2/cffi 
    copying cffi/_embedding.h -> build/lib.linux-i686-3.2/cffi 
    running build_ext 
    building '_cffi_backend' extension 
    creating build/temp.linux-i686-3.2 
    creating build/temp.linux-i686-3.2/c 
    gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.2mu -c c/_cffi_backend.c -o build/temp.linux-i686-3.2/c/_cffi_backend.o 
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory 
    compilation terminated. 

     error: command 'gcc' failed with exit status 1 

     Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-svu9h7/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lo33rp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-svu9h7/cffi 
You are using pip version 7.1.2, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
+0

你需要安裝一個包含ffi.h的包,http://stackoverflow.com/a/38077173/5781248 –

+0

可能重複[PIP安裝無法找到ffi.h,即使它識別libffi](http: //stackoverflow.com/questions/31508612/pip-install-unable-to-find-ffi-h-even-though-it-recognizes-libffi) –

回答

3

您需要libffi可用的開發頭文件,以便沿cffi可以針對它進行編譯。您可以通過執行apt-get install libffi-devyum install libffi-devel(或其他各種不太常見的分發命令)來獲得此信息。

但是,如果您升級到最新的點(正如您可以看到它在最後提示的那樣),您可以在沒有編譯器或libffi的情況下安裝它!這是因爲我今天早上上傳了cffimanylinux1輪。這些輪子是預編譯的,並附帶捆綁的libffi。如果您使用的是符合條件的分發點,則會自動使用這些輪子(假設您的分辨率爲8.1+以上),而不能使用它們的分發將繼續需要正常編譯。

此外,由於你的記錄表明你還安裝cryptography你需要openssl-devel在Debian/Ubuntu的衍生工具(在Red Hat的衍生物)或libssl-dev到有編譯成功。 (如果你還沒有編譯任何python包,你還需要python-develpython-dev)。

相關問題