I have installed libffi on my Linux server as well as correctly set the PKG_CONFIG_PATH environment variable to the correct directory, as pip
libffi
PKG_CONFIG_PATH
pip
On Debian,
apt-get install libffi-dev