idf.py not found

Rob190
Posts: 5
Joined: Mon May 27, 2024 11:40 am

idf.py not found

Postby Rob190 » Mon May 27, 2024 11:46 am

I'm using ESP-IDF in VSCode. I'm unable to run idf.py. Looking online, people advise against manually adding anything to the path variables but nothing else seems to work. The following is done within a VSCode terminal (i.e. within the IDE):

Code: Select all

All done! You can now run:
   export.bat
PS C:\Users\robert\Documents\VSCode\ESP32-test-1> C:\users\robert\esp\v5.2.1\esp-idf\export.bat 
Checking Python compatibility
Setting IDF_PATH: C:\Users\robert\esp\v5.2.1\esp-idf

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool cmake found in PATH: 3.12.1.
    C:\Users\robert\.espressif\tools\xtensa-esp-elf-gdb\12.1_20231023\xtensa-esp-elf-gdb\bin
    C:\Users\robert\.espressif\tools\riscv32-esp-elf-gdb\12.1_20231023\riscv32-esp-elf-gdb\bin
    C:\Users\robert\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin
    C:\Users\robert\.espressif\tools\riscv32-esp-elf\esp-13.2.0_20230928\riscv32-esp-elf\bin
    C:\Users\robert\.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin
    C:\Users\robert\.espressif\tools\cmake\3.24.0\bin
    C:\Users\robert\.espressif\tools\openocd-esp32\v0.12.0-esp32-20230921\openocd-esp32\bin
    C:\Users\robert\.espressif\tools\ninja\1.11.1\
    C:\Users\robert\.espressif\tools\idf-exe\1.0.3\
    C:\Users\robert\.espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64
    C:\Users\robert\.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64
    C:\Users\robert\.espressif\python_env\idf5.2_py3.11_env\Scripts
    C:\Users\robert\esp\v5.2.1\esp-idf\tools

Checking if Python packages are up to date...
Constraint file: C:\Users\robert\.espressif\espidf.constraints.v5.2.txt
 - C:\Users\robert\esp\v5.2.1\esp-idf\tools\requirements\requirements.core.txt
Python being checked: C:\Users\robert\.espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe
Python requirements are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build
PS C:\Users\robert\Documents\VSCode\ESP32-test-1> idf.py build
idf.py : The term 'idf.py' is not recognized as the name of a cmdlet, function, script file, or operable 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 build
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (idf.py:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

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

Re: idf.py not found

Postby ESP_Roland » Mon May 27, 2024 12:38 pm

Do you use pure Vscode without https://github.com/espressif/vscode-esp-idf-extension? This extension is built for convenience to achieve what you try to do yourself, and much more. See the features and setup guides in the linked page.

Rob190
Posts: 5
Joined: Mon May 27, 2024 11:40 am

Re: idf.py not found

Postby Rob190 » Mon May 27, 2024 4:52 pm

Do you use pure Vscode without https://github.com/espressif/vscode-esp-idf-extension? This extension is built for convenience to achieve what you try to do yourself, and much more. See the features and setup guides in the linked page.
I believe I am using the esp-idf extension. I can compile and upload using the IDE. It's just that the command line doesn't work.

But to check: In VSCode, on the left panel, under the platformIO 'alien' icon, there's an icon which looks identical to the one in the github project. The tooltip says 'ESP-IDF: Explorer'.

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Re: idf.py not found

Postby rrwatt » Tue Jun 11, 2024 2:07 am

I have a similar setup. I use VSCode with esp-idf extension to write the code, but I always use terminal window to build flash etc. This seems to work well. I would suggest trying that first to verify that there is nothing major wrong with your setup.

Rob190
Posts: 5
Joined: Mon May 27, 2024 11:40 am

Re: idf.py not found

Postby Rob190 » Thu Jun 13, 2024 10:09 am

What should I check in my setup? As far as I can tell, it's all ok.

There are a vast number of similar reports online. Lots of questions about which environment variables to set and complaints that they need to be set every time a new cmd window is opened. This is obviously a very common problem, dating back many years.

I also just tried to install the Espressif IDE from scratch (https://dl.espressif.com/dl/esp-idf/?idf=4.4) but the installation fails to complete. I filed a bug report. Seems I have no choice but to go back to using the Arduino framework for now.

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Re: idf.py not found

Postby rrwatt » Thu Jun 13, 2024 9:56 pm

I am working on a mac so I cannot vouch for the windows extension. If you cannot even install it, then I do not know how to help you. If you find a way to get esp idf on your computer, you will need to update your .profile to include something like this: alias get_idf='. $HOME/esp/esp-idf/export.sh'. Whenever you want to run esp idf, navigate into the directory with your code in a terminal window, run command get_idf (which you just aliased), and then it should work.

Who is online

Users browsing this forum: No registered users and 85 guests