Judging by the log you got from pip the problem here is that the development libraries for libffi are not installed. You can rectify it with:
$ sudo apt-get install libffi-dev
and retry installing.
The clue in your error log is this line:
Package libffi was not found in the pkg-config search path.
If pkg-config
is unable to find a library it means that the files needed to develop with this library are missing. On an Ubuntu or Debian system this usually means installing the package that has the name of the library plus -dev
.