Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PIP install unable to find ffi.h even though it recognizes libffi

Tags:

python

linux

pip

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 recognizes that it is installed; however, when trying to install pyOpenSSL, pip states that it cannot find file 'ffi.h'. I know both thatffi.h exists as well as its directory, so how do I go about closing this gap between ffi.h and pip?

like image 969
DonutGaz Avatar asked Jul 20 '15 03:07

DonutGaz


2 Answers

To add to mhawke's answer, usually the Debian/Ubuntu based systems are "-dev" rather than "-devel" for RPM based systems

So, for Ubuntu it will be apt-get install libffi libffi-dev

RHEL, CentOS, Fedora (up to v22) yum install libffi libffi-devel

Fedora 23+ dnf install libffi libffi-devel

OSX/MacOS (assuming homebrew is installed) brew install libffi

like image 22
ChrisN Avatar answered Oct 06 '22 05:10

ChrisN


You need to install the development package as well.

libffi-dev on Debian/Ubuntu, libffi-devel on Redhat/Centos/Fedora.

like image 187
Lennart Regebro Avatar answered Oct 06 '22 06:10

Lennart Regebro