Python can';t在fedora23工作站上安装cffi

Python can';t在fedora23工作站上安装cffi,python,fedora,python-cffi,libffi,Python,Fedora,Python Cffi,Libffi,我正在尝试使用pip3在fedora23工作站上安装cffi。 但我有以下错误 pip3 install cffi Collecting cffi Using cached cffi-1.4.2.tar.gz Complete output from command python setup.py egg_info: Package libffi was not found in the pkg-config search path. Perhaps you should add th

我正在尝试使用pip3在fedora23工作站上安装cffi。 但我有以下错误

pip3 install cffi

Collecting cffi

  Using cached cffi-1.4.2.tar.gz
Complete output from command python setup.py egg_info:

Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

    No working compiler found, or bogus compiler options
    passed to the compiler from Python's distutils module.
    See the error messages above.
    (If they are about -mno-fused-madd and you are on OS/X 10.8,
    see http://stackoverflow.com/questions/22313407/ .)

----------------------------------------
命令“python setup.py egg_info”失败,错误代码为1,位于/tmp/pip-build-yweqr7c9/cffi中

我该怎么办?
提前感谢。

正如Tom在评论中指出的,在编译cffi之前,您必须安装一些依赖项。然而,
libffi-devel
在我的例子中是不够的,还需要redhat-hardend-cc1作为
redhat rpm-config
的一部分。您可以使用安装它们

sudo dnf install libffi-devel redhat-rpm-config

现在您可以再次运行
pip3 install cffi
,它应该都可以编译。

这是新的安装。我还没有安装任何其他软件。请确保在运行
pip
之前安装了
dnf libffi-devel
。另外,您可能需要确保已安装了对我有效的
gcc
thanx@TomTromey。既然有问题的答案,您可以将其作为答案发布,并将其标记为已接受。问题的作者也可以这样做。