You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

pip安装functools失败:无法构建wheel包的问题求助

pip安装functools失败:无法构建wheel包的问题求助

各位大佬,我最近碰到一个折腾好久都没解决的问题,来求助大家了!

我目前使用的是Python 3.7.12版本,之前了解到functools在Python 3.9及以上是标准库自带的,但3.7版本需要手动安装?不过有意思的是,我现有的代码在没有安装functools的情况下是可以正常运行的,可当我尝试用pip安装它时,却出现了构建wheel失败的错误。

我分别在Linux和macOS系统上都试了一遍,得到的错误信息完全一致,具体内容如下:

Collecting functools
Using cached functools-0.5.tar.gz (4.9 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: functools
Building wheel for functools (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
src/compose.c:96:6: error: no member named 'ob_type' in 'struct compose'
co->ob_type->tp_free(co);
A long list of error descriptions in the middle*******
12 warnings and 3 errors generated.
error: command /usr/bin/gcc failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for functools
Running setup.py clean for functools
Failed to build functools
ERROR: Could not build wheels for functools, which is required to install pyproject.toml-based projects

我已经在两个系统上反复尝试,还全网搜了各种解决方案,但完全找不到头绪,感觉是不是我的环境里缺少了什么必要的依赖?有没有大佬能帮我分析一下这个问题,给点解决思路呀?

备注:内容来源于stack exchange,提问作者y2k23 martin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 08:59:35