Visual Studio Code install error [VSC-313]

Baldhead
Posts: 434
Joined: Sun Mar 31, 2019 5:16 am

Visual Studio Code install error [VSC-313]

Postby Baldhead » Mon Apr 27, 2020 5:56 am

Hi,

I am trying to install esp-idf on visual studio code using ESP-IDF Visual Studio Code Extension, but the error in figure in annex appears.

I had already configured the visual studio code manually with the esp-idf version "v4.1-dev-141-ga7e8d87d3" and it was working correctly.

But i decided to migrate to the new version of esp-idf "https://github.com/espressif/esp-idf", i don't know why i couldn't get the version with git describe.
I think "v4.2" something else.

I am using win10 pro version 10.0.17763 Compilation 17763.


Thank's for the help.
Attachments
vsc_install_err.png
vsc_install_err.png (376.59 KiB) Viewed 15994 times

Baldhead
Posts: 434
Joined: Sun Mar 31, 2019 5:16 am

Re: Visual Studio Code install error

Postby Baldhead » Tue Apr 28, 2020 12:09 am

Hi,

I decided to uninstall everything, including git and python and whatever was related.

I restarted the notebook just to make sure.

I downloaded the tools setup for windows: "https://dl.espressif.com/dl/esp-idf-tools-setup-2.3.exe".

And i let tools setup install all the necessary tools(everything, including esp-idf v4.2-dev-1235-g71dc5eb27, python, git and so on).

After this installation, the "ESP-IDF Command Prompt (cmd.exe)" opened.
I run "C:\esp-idf>git describe" and git returned me v4.2-dev-1235-g71dc5eb27.
I run idf.py menuconfig and run ok.
I configured project on menuconfig and all ok.

Afer save project config on menuconfig, i run idf.py buid and everything worked as expected.

So i decided to test it in visual studio code, using "Develop and debug applications for Espressif ESP32, ESP32-S2 chips with ESP-IDF" vsc plugin, and not worked.

In annex folows the image with the problem that i encountered.

I am waiting for a good soul to help me :).
Attachments
visual studio code error A.png
visual studio code error A.png (356.04 KiB) Viewed 15932 times
Last edited by Baldhead on Tue Apr 28, 2020 1:37 am, edited 1 time in total.

ESP_Alvin
Posts: 195
Joined: Thu May 17, 2018 2:26 am

Re: Visual Studio Code install error [VSC-313]

Postby ESP_Alvin » Tue Apr 28, 2020 1:20 am

Moderator's note: edit the topic title for issue tracking, thanks.

Baldhead
Posts: 434
Joined: Sun Mar 31, 2019 5:16 am

Re: Visual Studio Code install error [VSC-313]

Postby Baldhead » Tue Apr 28, 2020 2:23 am

Hi,

In windows cmd(administrator mode) i run: "python -m pip install --user -r %IDF_PATH%/requirements.txt".

After, i opened the project on vsc and started to config using espressif vsc plugin.

Other python "errors" appeared and a suggention to run: "python -m pip install -r c:\Users\myName\.vscode\extensions\espressif.esp-idf-extension-0.2.1\esp_debug_adapter\requirements.txt" appear.

I went back to the windows cmd and ran: "python -m pip install -r c:\Users\myName\.vscode\extensions\espressif.esp-idf-extension-0.2.1\esp_debug_adapter\requirements.txt".

After, i went back to the opened project on vsc and started to config using espressif vsc plugin again.

And worked(OK) message:
"Checking ESP-IDF Python requirements using python
Python requirements from c:\esp-idf\requirements.txt are satisfied."

"Checking Debug Adapter requirements using python
Python requirements from c:\Users\myName\.vscode\extensions\espressif.esp-idf-extension-0.2.1\esp_debug_adapter\requirements.txt are satisfied."

And appear a button written "Go to next step."

After clicked on button "Go to next step." the following message appeared:
"ESP-IDF Tools have been configured for this extension of Visual Studio Code".

The following paths would be added to env PATH
C:\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\bin;C:\.espressif\tools\xtensa-esp32s2-elf\esp-2020r1-8.2.0\xtensa-esp32s2-elf\bin;C:\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\.espressif\tools\cmake\3.16.4\bin;C:\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200420\openocd-esp32\bin;C:\.espressif\tools\ninja\1.10.0;C:\.espressif\tools\idf-exe\1.0.1;C:\.espressif\tools\ccache\3.7


NOTE:
I manually added
IDF_PATH C:\esp-idf
on windows system environment variables.
I don't know if it influenced anything or not.

User avatar
ESP_Roland
Posts: 242
Joined: Tue Oct 09, 2018 10:28 am

Re: Visual Studio Code install error [VSC-313]

Postby ESP_Roland » Tue Apr 28, 2020 10:45 am

Hello Baldhead,

An expert for Visual Studio Code will look at your issue.

In the meantime, I can help with Python. So your issue is now that you install the requirements but it still complains about that they are not installed? If that is the case then probably there are more Pythons installed in your system and you are switching between them, i.e. "python" one time means something else then the other time. You might try to run "where python" to see which one are you invoking. You might also try to print the PATH variable. Please try these from the terminal inside VSC.

Baldhead
Posts: 434
Joined: Sun Mar 31, 2019 5:16 am

Re: Visual Studio Code install error [VSC-313]

Postby Baldhead » Tue Apr 28, 2020 9:34 pm

Hi ESP_Roland,

I abandoned the espressif plugin and configured the visual studio code manually.
It's working now.
The espressif plugin seems to be promising.
Keep up the good work.

Regarding the attempt to install using the espressif plug-in,
I think that python dependencies are ok now, but the path was not configured.

"The following paths would be added to env PATH
C:\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\bin;C:\.espressif\tools\xtensa-esp32s2-elf\esp-2020r1-8.2.0\xtensa-esp32s2-elf\bin;C:\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\.espressif\tools\cmake\3.16.4\bin;C:\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200420\openocd-esp32\bin;C:\.espressif\tools\ninja\1.10.0;C:\.espressif\tools\idf-exe\1.0.1;C:\.espressif\tools\ccache\3.7".

And also in my manual configuration without the espressif plugin i can set the keyboard shortcuts(i dont know if espressif plugin alone ou "plugin more vsc" can do this).
For example: F5 build, F4 flash, F8 monitor and so on.

"If that is the case then probably there are more Pythons installed in your system and you are switching between them"
I uninstalled all python that appeared in the control panel (programs), but there was only 1 python installed, unless the control panel / programs was not showing other python. I have "Microsoft Visual Studio Community 2019" installed as well. I think he installs python too, I'm not sure.
But why would the plugin select another python if the plugin asks for the path to the folder where the python is installed ?

Thank's.

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

Re: Visual Studio Code install error [VSC-313]

Postby ESP_bignacio » Wed Apr 29, 2020 9:02 am

At that point of checking the tools it also check the python requirements using the extension python virtual env defined in idf.pythonBinPath but for some reason it reading the default value instead of the one when you download the tools from the extension.

The extension asks for your system python path for creating the virtual environment (same as ESP-IDF Tools Installer does) and save the virtual environment python path in idf.pythonBinPath like {TOOLS_DIR}/python_env/idf{IDF_VERSION}_py{PYTHON_VERSION}_env/bin/python

From what you detail, you have probably skipped the ESP-IDF tools download step within the extension and went straight to check the tools are correct. When you install ESP-IDF (either from Visual Studio Code or extension) you create a python virtual environment. The extension doesn't know where your python virtual env is, which is why we need the value defined in idf.pythonBinPath in your Visual Studio Code Settings for ESP-IDF extension.

For more info about how we configure the extension, please read https://github.com/espressif/vscode-esp ... OARDING.md. There is a PR in GitHub where you can add the python virtual env directly in the Skip Tools download step and we are looking into ways to make this easier.

Baldhead
Posts: 434
Joined: Sun Mar 31, 2019 5:16 am

Re: Visual Studio Code install error [VSC-313]

Postby Baldhead » Wed Apr 29, 2020 5:27 pm

Sorry, but i already visited the link https://github.com/espressif/vscode-esp ... OARDING.md, and i dont understand what this mean:

"Consider that installing ESP-IDF Python Requirements (In Step 2) will fail if your idf.pythonSystemBinPath is set to a Python virtual environment executable."

I was already suspicious that this could be the problem but i didn't understand what that means.

What is this and were i should put and how i should configure ?
idf.pythonSystemBinPath

A complete explanation would be useful.

Thank's.

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

Re: Visual Studio Code install error [VSC-313]

Postby ESP_bignacio » Thu Apr 30, 2020 9:29 am

We could probably improve this in the onboarding document, but in the Github repository README https://github.com/espressif/vscode-esp ... f-settings this is one of the settings the extension contributes. You will find in either settings.json or Visual Studio Code Preferences Open Settings (UI) in the ESP-IDF section.

oreider
Posts: 1
Joined: Tue Oct 20, 2020 11:40 am

Re: Visual Studio Code install error [VSC-313]

Postby oreider » Tue Oct 20, 2020 11:49 am

I had the same problem and solved it follwing a comment from this youtube video: https://www.youtube.com/watch?v=Zw0cMsIP45g

Overview:
OS: Windows 10

Solution:
1. Open CMD
2. Naviagate to: C:\Users\(yourUser)\.espressif\python_env\idf(yourVersion)\Scripts
e.g: C:\Users\steve\.espressif\python_env\idf4.1_py3.8_env\Scripts
3. Type in the following command to install missing dependencies (This command uses the python.exe in the virtual environment and installs the dependencies, listed in the requirements.txt in the VS Code Extensions Folder
python.exe -m pip install -r c:\Users\steve\.vscode\extensions\espressif.esp-idf-extension-0.5.1\esp_debug_adapter\requirements.txt
4. Try the idf onboarding again

Who is online

Users browsing this forum: No registered users and 57 guests