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

ESP32 Cam接入HomeKit编译报错:cmake需在PATH中/idf.py找不到

ESP32 HomeKit摄像头编译问题修复(MacOS Ventura)

问题回顾

按步骤克隆项目与ESP-IDF后,执行idf.py build先提示"cmake" must be available on the PATH to use idf.py,手动添加错误路径后又出现zsh: command not found: idf.py。

修复步骤

1. 移除错误的路径配置

执行sudo nano /etc/paths,删除之前添加的/usr/local/Desktop/Skripte/Mikrocontroller/HomeKit/esp-idf/tools/cmake行,按Ctrl+O保存、回车确认,再按Ctrl+X退出编辑器。

2. 正确安装CMake

推荐用Homebrew安装(若未安装Homebrew,先执行/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"完成安装):

brew install cmake

此方式会自动将CMake加入系统PATH,无需手动配置。

3. 重新加载ESP-IDF环境变量

ESP-IDF的export.sh脚本会自动配置idf.py、CMake等工具的路径,执行:

source /Users/<user>/Desktop/Skripte/Mikrocontroller/HomeKit/esp-idf/export.sh

注意:每次新开终端都需执行此命令,若想自动加载,可将该命令添加到zsh配置文件:

echo 'source /Users/<user>/Desktop/Skripte/Mikrocontroller/HomeKit/esp-idf/export.sh' >> ~/.zshrc

执行后重启终端即可生效。

4. 重新编译项目

回到项目目录执行编译命令:

cd /Users/<user>/Desktop/Skripte/Mikrocontroller/HomeKit/esp32-homekit-camera
idf.py build

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.29 23:30:27