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

前端 未结 8 1278
遥遥无期
遥遥无期 2020-12-15 02:37

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

相关标签:
8条回答
  • 2020-12-15 02:43

    On Debian,

    apt-get install libffi-dev
    
    0 讨论(0)
  • 2020-12-15 02:46

    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

    0 讨论(0)
  • 2020-12-15 02:54

    Ubuntu/Mint

    sudo apt-get install libffi6 libffi-dev 
    
    0 讨论(0)
  • 2020-12-15 03:00

    You can use CFLAGS (and LDFLAGS or various other compiler and linker options) in front of the pip command (ditto for setup.py):

    Something similar to the following should work:

    CFLAGS=-I/usr/include/libffi/include pip install pyOpenSSL
    
    0 讨论(0)
  • 2020-12-15 03:01

    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.

    0 讨论(0)
  • 2020-12-15 03:04

    on CentOS:

    yum install libffi-devel
    
    0 讨论(0)
提交回复
热议问题