To add to alecxe's answer, for Ubuntu/Debian systems, first install the dependencies (webkit, gtk2 and jswebkit)
sudo apt-get install python-jswebkit libwebkitgtk-1.0-0 python-webkit
sudo apt-get install python-gtk2 python-gnome2 python-glade2 python-gobject
If you are working with a virtualenv you'll have to symlink the libs you installed
mkdir your-venv/lib/python2.7/dist-packages
ln -s /usr/lib/python2.7/dist-packages/gtk-2.0* lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/pygtk.pth lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/gobject/ lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/glib/ lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/cairo lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/webkit lib/python2.7/dist-packages/
ln -s /usr/lib/python2.7/dist-packages/jswebkit.so lib/python2.7/dist-packages/
To use the patch method, find out where your scrapy lives (if you don't already)
python -c "import scrapy; print scrapy.__file__"
This will give you the location of the compiled bytecode of Scrapy's __init__.py
. Go to that directory and add the following lines in __init__.py
from twisted.internet import gtk2reactor
gtk2reactor.install()