title: Unable to insall Scrapy : "error: command 'gcc' failed with exit status 1"?
body: <p>I am trying to install Scrapy using following command:</p>
  
  <pre><code>$ sudo pip install scrapy
  </code></pre>
  
  <p>But after this, it shows following output with an error:</p>
  
  <pre><code>Collecting scrapy
  Requirement already satisfied (use --upgrade to upgrade): cssselect&gt;=0.9 in /usr/local/lib/python3.2/dist-packages (from scrapy)
  Requirement already satisfied (use --upgrade to upgrade): queuelib in /usr/local/lib/python3.2/dist-packages (from scrapy)
  Collecting pyOpenSSL (from scrapy)
    Downloading pyOpenSSL-0.15.1-py2.py3-none-any.whl (102kB)
      100% |████████████████████████████████| 106kB 49kB/s 
  Collecting w3lib&gt;=1.8.0 (from scrapy)
    Downloading w3lib-1.12.0-py2.py3-none-any.whl
  Collecting lxml (from scrapy)
    Downloading lxml-3.4.4.tar.gz (3.5MB)
      100% |████████████████████████████████| 3.5MB 17kB/s 
  Collecting Twisted&gt;=10.0.0 (from scrapy)
  Requirement already satisfied (use --upgrade to upgrade): six&gt;=1.5.2 in /usr/local/lib/python3.2/dist-packages (from scrapy)
  Collecting service-identity (from scrapy)
    Downloading service_identity-14.0.0-py2.py3-none-any.whl
  Collecting cryptography&gt;=0.7 (from pyOpenSSL-&gt;scrapy)
    Downloading cryptography-1.1.tar.gz (348kB)
      100% |████████████████████████████████| 352kB 404kB/s 
  Collecting zope.interface&gt;=4.0.2 (from Twisted&gt;=10.0.0-&gt;scrapy)
  Collecting characteristic&gt;=14.0.0 (from service-identity-&gt;scrapy)
    Downloading characteristic-14.3.0-py2.py3-none-any.whl
  Collecting pyasn1-modules (from service-identity-&gt;scrapy)
    Downloading pyasn1_modules-0.0.8-py2.py3-none-any.whl
  Requirement already satisfied (use --upgrade to upgrade): pyasn1 in /usr/local/lib/python3.2/dist-packages (from service-identity-&gt;scrapy)
  Requirement already satisfied (use --upgrade to upgrade): idna&gt;=2.0 in /usr/local/lib/python3.2/dist-packages (from cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
  Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python3.2/dist-packages (from cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
  Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python3.2/dist-packages (from cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
  Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/local/lib/python3.2/dist-packages (from cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
  Collecting cffi&gt;=1.1.0 (from cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
    Downloading cffi-1.3.0.tar.gz (347kB)
      100% |████████████████████████████████| 348kB 9.7kB/s 
  Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python3.2/dist-packages (from cffi&gt;=1.1.0-&gt;cryptography&gt;=0.7-&gt;pyOpenSSL-&gt;scrapy)
  Installing collected packages: cffi, cryptography, pyOpenSSL, w3lib, lxml, zope.interface, Twisted, characteristic, pyasn1-modules, service-identity, scrapy
    Running setup.py install for cffi
      Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-mdfh82/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lluuq6-record/install-record.txt --single-version-externally-managed --compile:
      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/backend_ctypes.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/gc_weakref.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/vengine_cpy.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/lock.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/api.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/__init__.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/model.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/ffiplatform.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/cparser.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/verifier.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/cffi_opcode.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/recompiler.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/commontypes.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/setuptools_ext.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/vengine_gen.py -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/_cffi_include.h -&gt; build/lib.linux-i686-3.2/cffi
      copying cffi/parse_c_type.h -&gt; 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/python3.2mu -c c/_cffi_backend.c -o build/temp.linux-i686-3.2/c/_cffi_backend.o
      c/_cffi_backend.c:2:20: fatal error: Python.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-mdfh82/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lluuq6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-mdfh82/cffi
  FAIL
  </code></pre>
  
  <p>I searched for any solution and on the basis of one of the recommendation I also tried to install <code>python-dev</code> using command : </p>
  
  <p><code>$ sudo apt-get install python-dev</code></p>
  
  <p>But this too showed that <code>python-dev</code> is the newest version:</p>
  
  <pre><code>Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  python-dev is already the newest version.
  </code></pre>
  
  <p>Can anybody help me in solving this issue?</p>