gpt4 book ai didi

python - 无法在 fedora23 工作站上安装 cffi

转载 作者:行者123 更新时间:2023-12-01 04:13:53 28 4
gpt4 key购买 nike

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

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com