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

Mac M1安装fastavro报错:'Python.h'文件未找到求解决

在Mac M1上安装fastavro时出现'Python.h'文件找不到的编译错误

我在Mac M1笔记本上尝试安装fastavro时遇到如下编译错误:

Headers -c fastavro/_read.c -o build/temp.macosx-10.9-universal2-cpython-39/fastavro/_read.o
fastavro/_read.c:6:10: fatal error: 'Python.h' file not found
#include "Python.h"
         ^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' 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 fastavro
ERROR: Could not build wheels for fastavro, which is required to install pyproject.toml-based projects

我的环境信息如下:

Python 3.9.6
virtualenv==20.16.6

% sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115

恳请各位提供解决思路,非常感谢!

内容的提问来源于stack exchange,提问作者Zichen Ma

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 02:50:38