我正在尝试使用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”在/ tmp / pip-build-yweqr7c9 / cffi中失败,错误代码为1

我该怎么办?
提前感谢。

最佳答案

正如Tom的评论中指出的那样,在编译cffi之前必须先安装一些依赖项。但是,对于我来说,仅libffi-devel是不够的,还需要redhat-hardened-cc1作为redhat-rpm-config的一部分。您可以使用

sudo dnf install libffi-devel redhat-rpm-config


现在,您可以再次运行pip3 install cffi,并且应该全部编译。

关于python - 无法在fedora23工作站上安装cffi,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34554599/

10-11 02:46