2014-07-23 17 views
8

स्थापित करने मैं scrapy स्थापित करने के लिए कोशिश कर रहा हूँ, यह निम्न त्रुटि देता है:के दौरान त्रुटि 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 

आप कृपया मुझे त्रुटि को हल करने में मदद कर सकते हैं।

+0

डुप्लिकेट: http://stackoverflow.com/questions/22095855/error-installing-scrapy-0-22 -ऑन-ubuntu-12-04-gcc-fail-with-exit-status-1 – Alex

उत्तर

3

मुझे उबंटू में पाइप के साथ क्रिप्टोग्राफी स्थापित करने में यह त्रुटि मिली है। Libffi-dev स्थापित करने के लिए यह मेरे लिए तय किया। यदि यह काम नहीं करता है, तो आपको libssl-dev इंस्टॉल करने की भी आवश्यकता हो सकती है। आप कौन से ऑपरेटिंग सिस्टम का उपयोग कर रहे हैं?

20

मुझे एक ही समस्या का सामना करना पड़ा। मैं निम्न आदेश

sudo apt-get install libffi-dev 

उसके बाद साथ libffi-देव स्थापित, मैं scrapy स्थापित। कोई मुद्दा नहीं था।

+2

@GreenAsJade: मुझे लगता है कि पोस्टर ओपी की समस्या को ठीक करने के लिए स्केपर स्थापित करने से पहले "libffi-dev" स्थापित करने का प्रस्ताव करता है। तो मुझे लगता है कि यह एक वैध जवाब है, चाहे वह काम करता है या नहीं। – honk

+1

आप सही हैं - मैंने अपनी टिप्पणी और डाउनवोट हटा दिया! – GreenAsJade

2

CentOS (या अमेज़न लिनक्स) में

sudo yum install -y libffi libffi-devel

मेरे लिए उपयोगी है

संबंधित मुद्दे