即使PIP安装可以识别libffi,也无法找到ffi.h [英] PIP install unable to find ffi.h even though it recognizes libffi
问题描述
我已经在Linux服务器上安装了libffi
,并且已将PKG_CONFIG_PATH
环境变量正确设置为正确的目录,因为pip
识别出已安装该变量;但是,在尝试安装pyOpenSSL时,pip指出找不到文件'ffi.h'.我知道ffi.h
以及它的目录都存在,所以我该如何缩小ffi.h
和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
?
推荐答案
您可以在pip
命令(setup.py
的同上)之前使用CFLAGS
(以及LDFLAGS
或其他各种编译器和链接器选项) ):
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
这篇关于即使PIP安装可以识别libffi,也无法找到ffi.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!