Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when installing Scrapy on Ubuntu 13.04

When I try to install Scrapy on ubuntu 13.04 with the command sudo easy_install -U Scrapy, I get the following error:

Searching for Scrapy
Reading pypi.python.org/simple/Scrapy/
Best match: Scrapy 0.16.5
Processing Scrapy-0.16.5-py2.7.egg
Scrapy 0.16.5 is already the active version in easy-install.pth
Installing scrapy script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/Scrapy-0.16.5-py2.7.egg
Processing dependencies for Scrapy
Searching for Twisted>=8.0
Reading pypi.python.org/simple/Twisted/
Best match: Twisted 13.1.0
Downloading pypi.python.org/packages/source/T/Twisted/Twisted-13.1.0.tar.bz2#md5=5609c91ed465f5a7da48d30a0e7b6960
Processing Twisted-13.1.0.tar.bz2
Writing /tmp/easy_install-xYafJF/Twisted-13.1.0/setup.cfg
Running Twisted-13.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-xYafJF/Twisted-13.1.0/egg-dist-tmp-ybetxt
twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I also tried pip install Scrapy command but again I get the same error x86_64-linux-gnu-gcc

Could you please help me to install Scrapy on Ubuntu 13.04?

like image 627
Burak Karacay Avatar asked Jul 12 '13 09:07

Burak Karacay


People also ask

Does Scrapy work with python3?

Scrapy runs on Python 2.7 and Python 3.3 or above (except on Windows where Python 3 is not supported yet). We strongly recommend that you install Scrapy in a dedicated virtualenv, to avoid conflicting with your system packages.

How do I know if Scrapy is installed?

You can check that Scrapy is installed correctly by running scrapy bench .


3 Answers

Use this : sudo apt-get install libssl-dev

before installing scrapy. and then

sudo pip install scrapy --force --upgrade

like image 173
Manoj Sahu Avatar answered Oct 13 '22 16:10

Manoj Sahu


For me, I had python dev installed but still wasnt working (was failing when trying to install cryptography) and I found this stack overflow post which says to run this command to guarantee all dependencies are installed

sudo apt-get install build-essential libssl-dev libffi-dev python-dev libxml2-dev

and that worked for me

like image 29
Bobby Avatar answered Oct 13 '22 16:10

Bobby


In order to install scrapy, you need to have python dev installed first.

like image 21
dustin Avatar answered Oct 13 '22 18:10

dustin