0

我已经在我的 Windows 10 机器上的 Visual Studio 代码上安装了 ESP-IDF 扩展。当我试图打开监视器时,它会抛出以下错误

C:\Users\femik\Desktop\esp\blink>C:\Users\femik\.espressif\python_env\idf4.1_py3.8_env\Scripts\python.exe C:\Users\femik\esp\esp-idf\tools\idf.py -p COM16 monitor
Traceback (most recent call last):
  File "C:\Users\femik\esp\esp-idf\tools\idf.py", line 775, in <module>
    main()
  File "C:\Users\femik\esp\esp-idf\tools\idf.py", line 691, in main    
    checks_output = check_environment()
  File "C:\Users\femik\esp\esp-idf\tools\idf.py", line 64, in check_environment
    print_idf_version()
  File "C:\Users\femik\esp\esp-idf\tools\idf.py", line 113, in print_idf_version
    version = idf_version()
  File "C:\Users\femik\esp\esp-idf\tools\idf_py_actions\tools.py", line 55, in idf_version
    "--git-dir=%s" % os.path.join(os.environ["IDF_PATH"], '.git'),
  File "C:\Users\femik\AppData\Local\Programs\Python\Python38\lib\os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'IDF_PATH'

尝试时命令idf.py -p COM16 monitor正在工作

4

1 回答 1

0

使用此命令:

cmd.exe /k  C:\Users\dell\esp\esp-idf\export.bat

备注:在我的情况下 esp-idf 是这个根“C:\Users\dell\esp\esp-idf”请确保使用正确的路径

于 2021-04-27T14:39:34.020 回答