【问题标题】:can't install cffi on fedora23 workstation无法在 fedora23 工作站上安装 cffi
【发布时间】:2016-04-05 21:47:43
【问题描述】:

我正在尝试使用 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

我该怎么办? 提前谢谢。

【问题讨论】:

  • 全新安装。我还没有安装其他任何东西。
  • 在运行 pip 之前确保您 dnf install libffi-devel。此外,您可能需要确保已安装 gcc
  • 感谢 @TomTromey 为我工作。
  • 既然问题有答案,您可以将其发布为答案并将其标记为已接受。题主也可以。

标签: python fedora python-cffi libffi


【解决方案1】:

正如 Tom 在 cmets 中指出的那样,您必须先安装一些依赖项,然后才能编译 cffi。但是,在我的情况下,仅libffi-devel 是不够的,还需要将 redhat-hardened-cc1 作为redhat-rpm-config 的一部分。你可以安装它们

sudo dnf install libffi-devel redhat-rpm-config

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

【讨论】:

    猜你喜欢
    • 2016-10-15
    • 2019-01-22
    • 2020-02-12
    • 2015-07-09
    • 2015-03-31
    • 1970-01-01
    • 2010-11-07
    • 2015-09-22
    • 2015-02-28
    相关资源
    最近更新 更多