2014-07-23 16 views
8

Próbuję zainstalować scrapy, daje następujący błąd:Błąd podczas instalowania scrapy

Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->Scrapy) 
    Running setup.py egg_info for package cryptography 
    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 
    c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory 
    compilation terminated. 
    Traceback (most recent call last): 
     File "<string>", line 14, in <module> 
     File "/home/nilesh/build/cryptography/setup.py", line 174, in <module> 
     "test": PyTest, 
     File "/usr/lib/python2.7/distutils/core.py", line 112, in setup 
     _setup_distribution = dist = klass(attrs) 
     File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 221, in __init__ 
     self.fetch_build_eggs(attrs.pop('setup_requires')) 
     File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 245, in fetch_build_eggs 
     parse_requirements(requires), installer=self.fetch_build_egg 
     File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 576, in resolve 
     dist = best[req.key] = env.best_match(req, self, installer) 
     File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 821, in best_match 
     return self.obtain(req, installer) # try and download/install 
     File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 833, in obtain 
     return installer(requirement) 
     File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 294, in fetch_build_egg 
     return cmd.easy_install(req) 
     File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install 
     return self.install_item(spec, dist.location, tmpdir, deps) 
     File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 638, in install_item 
     dists = self.install_eggs(spec, download, tmpdir) 
     File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs 
     return self.build_and_install(setup_script, setup_base) 
     File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install 
     self.run_setup(setup_script, setup_base, args) 
     File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1096, in run_setup 
     raise DistutilsError("Setup script exited with %s" % (v.args[0],)) 
    distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1 
    Complete output from command python setup.py egg_info: 
    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 

c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory 

compilation terminated. 

Traceback (most recent call last): 

    File "<string>", line 14, in <module> 

    File "/home/nilesh/build/cryptography/setup.py", line 174, in <module> 

    "test": PyTest, 

    File "/usr/lib/python2.7/distutils/core.py", line 112, in setup 

    _setup_distribution = dist = klass(attrs) 

    File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 221, in __init__ 

    self.fetch_build_eggs(attrs.pop('setup_requires')) 

    File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 245, in fetch_build_eggs 

    parse_requirements(requires), installer=self.fetch_build_egg 

    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 576, in resolve 

    dist = best[req.key] = env.best_match(req, self, installer) 

    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 821, in best_match 

    return self.obtain(req, installer) # try and download/install 

    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 833, in obtain 

    return installer(requirement) 

    File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 294, in fetch_build_egg 

    return cmd.easy_install(req) 

    File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install 

    return self.install_item(spec, dist.location, tmpdir, deps) 

    File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 638, in install_item 

    dists = self.install_eggs(spec, download, tmpdir) 

    File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs 

    return self.build_and_install(setup_script, setup_base) 

    File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install 

    self.run_setup(setup_script, setup_base, args) 

    File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1096, in run_setup 

    raise DistutilsError("Setup script exited with %s" % (v.args[0],)) 

distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1 

Czy możesz mi pomóc w rozwiązaniu błędu.

+0

Duplikat: http://stackoverflow.com/questions/22095855/error-installing-scrapy-0-22 -on-ubuntu-12-04-gcc-failed-with-exit-status-1 – Alex

Odpowiedz

3

Dostałem ten błąd w systemie Ubuntu instalującym kryptografię za pomocą pip. Instalowanie libffi-dev naprawiło to dla mnie. Jeśli to nie zadziała, być może będziesz musiał zainstalować libssl-dev. Jakiego systemu operacyjnego używasz?

20

Zmierzyłem się z tym samym problemem. zainstalowaniu libffi-dev z poleceniem

sudo apt-get install libffi-dev 

Następnie zainstalowaniu scrapy. Nie było problemu.

+2

@GreenAsJade: Myślę, że plakat proponuje instalację "libffi-dev" przed instalacją Scrapy w celu naprawienia problemu OP. Myślę więc, że jest to ważna odpowiedź, niezależnie od tego, czy działa, czy nie. – honk

+1

Masz rację - usunąłem mój komentarz i głosowanie! – GreenAsJade

2

W CentOS (lub Amazon Linux)

sudo yum install -y libffi libffi-devel

jest przydatna dla mnie

Powiązane problemy