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
?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
pip
packages usually don't usepkg-config
. Therefore, you should setCFLAGS
andLDFLAGS
manually:You can use
CFLAGS
(andLDFLAGS
or various other compiler and linker options) in front of thepip
command (ditto forsetup.py
):Something similar to the following should work:
You need to install the development package as well.
libffi-dev
on Debian/Ubuntu,libffi-devel
on Redhat/Centos/Fedora.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
You need to install the development package for
libffi
.On RPM based systems (Fedora, Redhat, CentOS etc) the package is named
libffi-devel
.Not sure about Debian/Ubuntu systems, I'm sure someone else will pipe up with that.
On Debian,