我已经设置了我的环境变量来使用 esp32 工具链。核心功能之一是 idf.py,需要从终端访问它。
如果我尝试在 VS Code 中访问它,我会得到
idf.py : The term 'idf.py' is not recognized as the name of a cmdlet,
function, script file, oroperable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ idf.py
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (idf.py:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
是我的 echo %path% 的图片,您可以在其中看到我已经明确指出 idf.py.exe 是一个路径。不幸的是,我很困惑,不确定下一步是什么。
杀死终端并打开 ESP-IDF 终端
有同样的问题。通过确保我的 idf.espIdfPath(转到文件,然后是首选项,然后是设置,然后搜索“idf.espIdfPath”)指向正确的环境变量(我的是从系统环境变量指向 IDF_TOOLS,但应该是而是指向 IDF_TOOLS_PATH)。修复该问题,然后通过键入“code”从 ESP-IDF 终端重新启动 vscode。从项目目录。这似乎可以解决问题。最坏的情况,我知道这不是理想的选择,也许重新安装 vscode 和所有你需要的扩展?