ESP-IDF setup error in vscode with ESP-IDF extension

jhlee1
Posts: 8
Joined: Mon Sep 11, 2023 7:03 am

ESP-IDF setup error in vscode with ESP-IDF extension

Postby jhlee1 » Wed Jun 12, 2024 5:34 am

Install ESP-IDF: v5.2.2
VSCode: v1.90.0
ESP-IDF Extension: v1.7.1

Hi,
I try to install ESP-IDF stable version(v5.2.2) in VSCode
But, I face error message when install it.

ESP-IDF was install in directory, but setup in vscode with esp-idf extension is not completed

Steps to reproduce.
1. Install VSCode and ESP-IDF Extension

2. write "ESP-IDF: Configure ESP-IDF extension" in command palette and click

3. click "EXPRESS"
step3.png
step3.png (31.95 KiB) Viewed 4337 times

4. Select ESP-IDF v5.2.2 and install
step4.png
step4.png (20.09 KiB) Viewed 4337 times

When complete install, face error message.
setup error message.png
setup error message.png (24.53 KiB) Viewed 4337 times

When creating an example in VSCode("ESP-IDF:Show Example Project" in the command palette), the ESP-IDF version v5.2.2 is not activated, and when checking the USE EXISTING SETUP item in "ESP-IDF: Configure ESP-IDF extension", v5.2.2 does not appear.

How can I complete setup?

Thanks.

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: ESP-IDF setup error in vscode with ESP-IDF extension

Postby ESP_bignacio » Fri Jun 14, 2024 4:56 am

In Visual Studio Code select menu View then click Command Palette... and type ESP-IDF: Doctor Command to generate a report of your environment configuration and it will be copied in your clipboard to paste anywhere.
Check log file which can be obtained from:
Windows: %USERPROFILE%\.vscode\extensions\espressif.esp-idf-extension-VERSION\esp_idf_vsc_ext.log
Linux & MacOSX: $HOME/.vscode/extensions/espressif.esp-idf-extension-VERSION/esp_idf_vsc_ext.log

Could you share this information to find out the error ?

jhlee1
Posts: 8
Joined: Mon Sep 11, 2023 7:03 am

Re: ESP-IDF setup error in vscode with ESP-IDF extension

Postby jhlee1 » Mon Jun 17, 2024 10:39 am

Hi,
I found below in log file you mentioned:

Error: Command failed: \"d:\\esp\\espressif\\tools\\idf-python\\3.11.2\\python.exe\" \"d:\\esp\\v5.2.2\\esp-idf\\tools\\idf_tools.py\" install-python-env\nERROR: Python environment is set to d:\\esp\\espressif\\python_env\\idf5.2_py3.11_env which was generated for ESP-IDF v5.2.2 instead of the current 5.2. The issue can be solved by (1) removing the directory and re-running the install script, or (2) unsetting the IDF_PYTHON_ENV_PATH environment variable, or (3) re-runing the install script from a clean shell where an ESP-IDF environment is not active.

I tried the first method suggested in the log, and the installation appears to have completed normally in VSCode.
esp-idf_v5.2.2 settup.png
esp-idf_v5.2.2 settup.png (13.48 KiB) Viewed 4105 times
It has been resolved, but I think the same problem appears to occur even if v5.2.2 is additionally installed in an environment where the v5.2 version is installed.

jhlee1
Posts: 8
Joined: Mon Sep 11, 2023 7:03 am

Re: ESP-IDF setup error in vscode with ESP-IDF extension

Postby jhlee1 » Tue Jun 18, 2024 12:31 am

There is only one difference between IDF setup success and failure.

It just need to add `idf_version.txt` in <IDF_TOOLS_PATH>\python_env\idf5.2_py3.11_env before download or search ESP-IDF setup.
Content of `idf_version.txt` file is `5.2`.

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: ESP-IDF setup error in vscode with ESP-IDF extension

Postby ESP_bignacio » Fri Jun 21, 2024 8:15 am

We should have a fix in this vsix installer and it will be part of the next v1.8.0 release.

You can try by uninstall your current esp-idf vscode extension and install the vsix from the link with Install from VSIX command in vscode.

Who is online

Users browsing this forum: No registered users and 12 guests