Error installing scrapy in virtualenv using pip

I got this error, too. The problem is

 No package 'libffi' found
 c/_cffi_backend.c:13:17: fatal error: ffi.h: No such file or directory
 #include <ffi.h>

You should do this:

sudo apt-get install libffi-dev

From a fresh installation of 14.04, I had to install python-dev, libffi-dev, libssl-dev, libxml2-dev, and libxslt1-dev packages. Once those were installed, pip install scrapy worked fine.

sudo apt-get install python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev
pip install scrapy