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
You will need the development version of libffi to install libraries which depends on libffi :
sudo yum install libffi-devel
This worked for me
try after installing:
sudo apt-get install libffi6 libffi-dev
Faced a similar issue while installing paramiko using pip3:
$ pip3 install paramiko
ERROR:
Package libffi was not found in the pkg-config search path. Perhaps you should add the directory containing `libffi.pc' to the PKG_CONFIG_PATH environment variable No package 'libffi' found
No package 'libffi' found c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory compilation terminated.
distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
RESOLUTION:
$ sudo apt-get install libffi-dev
$ pip3 install paramiko
Successfully installed asn1crypto bcrypt cffi cryptography-1.2.3 paramiko-1.16.0 pycparser pynacl six-1.10.0
try this
sudo apt-get install -y python3-cffi
I was using python 3.8 and getting the same error while wheel was trying to setup cffi on a conda environment. I tried installing libffi and libffi-dev (and exiting the terminal and reactivating the environment each time was installing something!) but with no luck. I then thought that maybe downgrading python to 3.7 might solve the issue. I did that in my conda environment (just activated the environment and ran conda install python=3.7 and then all of the sudden libffi was found! wheel was able to setup cffi and all were working like a charm!
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