Clean setup vscode + IDF extension: The term 'PYTHON_INTERPRETER' is not recognized

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Clean setup vscode + IDF extension: The term 'PYTHON_INTERPRETER' is not recognized

Postby espdorian » Fri Jan 15, 2021 7:21 am

After trying sereval times to get VS code with debugging running on my desktop PC, I decided to try it on my laptop.
Laptop runs windows 10, had never had an install of VScode, Python and ESP.

Followed this flow (no settings changed, everything left at default)
Installed vscode
Installed Python 3.9.1
Installed Git 2.30.02
Installed IDF extension 0.6.0
Execute command: Configure IDF extension, choose "expres install"
After some time -> "All settings have been configured and you can close this window"

Checked settings.json as described in https://github.com/espressif/vscode-esp ... s/SETUP.md no obvious errors.

Then the next step:
Make sure to install the extension and extension debug adapter Python requirements by running the following commands in your terminal:

PYTHON_INTERPRETER -m pip install -r EXTENSION_PATH/requirements.txt

Which results in: "The term 'PYTHON_INTERPRETER' is not recognized"

Or do I have to replace PYTHON_INTERPRETER with the path to a python interpreter here ?
running the following commands in your terminal

Which terminal is meant here. I tried in within the VS code terminal.

What else can be wrong ?

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

Re: Clean setup vscode + IDF extension: The term 'PYTHON_INTERPRETER' is not recognized

Postby ESP_bignacio » Thu Jan 21, 2021 9:07 am

PYTHON_INTERPRETER is the "Using Python interpreter in" value generated by $IDF_PATH/export.sh
if you used the ESP-IDF: Configure ESP-IDF extension setup wizard you don't need to manually configure settings.json, this is just for manual extension configuration.

If you installed using ESP-IDF Windows Installer or using the command line then you can use this JSON Manual Configuration.

Yes, replace PYTHON_INTERPRETER for the python executable of the .espressif directory virtual environment. Example:

Code: Select all

/home/myUser/.espressif/python_env/idf4.0_py3.5_env/bin/python

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Re: Clean setup vscode + IDF extension: The term 'PYTHON_INTERPRETER' is not recognized

Postby espdorian » Sat Jan 23, 2021 3:40 pm

Thanks for the reply.
On my PC (Windows) the Python executable was not in <pyhton venv>/bin/ but in /scripts/
But unfortunately executing the command results in the following error:

ERROR: Could not install packages due to an EnvironmentError: [WinError 53] The network path was not found: '\\\\${IDF_PATH}\\tools\\kconfig_new\\esp-windows-curses'

That was easy to fix by adding IDF_PATH with the basepath of the idf directory to the system environment.

- After running the command, opened the folder "blink" from the ESP examples directory and build it.
- Pressed F5 for debugging -> Choosed GDB option ( Is this the correct one ?? )
- Got error messages, because executable name and path to GDB excutable are not correct in launch.json
so had to edit it.
This contradicts with your reply:
if you used the ESP-IDF: Configure ESP-IDF extension setup wizard you don't need to manually configure settings.json, this is just for manual extension configuration
After editing pressed F5 again to start debugging.

VScode terminal show this command:

Code: Select all

'c:\Users\my_name\.vscode\extensions\ms-vscode.cpptools-1.1.3\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-q3ho3zuu.bgy' '--stdout=Microsoft-MIEngine-Out-iyaro2zz.och' '--stderr=Microsoft-MIEngine-Error-exxiajgc.ptc' '--pid=Microsoft-MIEngine-Pid-f3ugx1n1.2yp' '--dbgExe=C:/Users/my_name/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe' 'PS C:\Users\my_name\esp\esp-idf\examples\get-started\blink>  & 'c:\Users\my_name\.vscode\extensions\ms-vscode.cpptools-1.1.3\debugAdapters\bin\WindowsDebugLaunch
And the debug console shows: "Unable to start debugging unexpected GDB output from command "-exec-run"

What do I wrong ?
This is my second attempt on a completely different Windows 10 computer, which never had any ESP/VScode/Python install and it seems impossible to debug the 'blink' example after installation. :?

Who is online

Users browsing this forum: No registered users and 28 guests