即使PIP安装可以识别libffi,也无法找到ffi.h [英] PIP install unable to find ffi.h even though it recognizes libffi

查看:163
本文介绍了即使PIP安装可以识别libffi,也无法找到ffi.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Linux服务器上安装了libffi,并且已将PKG_CONFIG_PATH环境变量正确设置为正确的目录,因为pip识别出已安装该变量;但是,在尝试安装pyOpenSSL时,pip指出找不到文件'ffi.h'.我知道ffi.h以及它的目录都存在,所以我该如何缩小ffi.hpip之间的差距?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆