I am trying to run setup.py related to a proprietary software installation and it has dependencies on libffi.
Since its Redhat 6.5 the python version was 2.6 and i i
I had the same issue for MacOS. I assume the solution should be similar.
nano ~/.bash_profile
Add these two lines below to the end of your bash_profile so that it can be discovered
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
export LDFLAGS="-L/usr/local/opt/libffi/lib"
Save and quit and restart Terminal