User's Manual

3.4.1. Windows
Search for "Edit Environment Variables" on Windows 10.
Click New... and add a new system variable IDF_PATH. The configuration should
include an ESP-IDF directory, such as C:\Users\user-name\esp\esp-idf.
Add ;%IDF_PATH%\tools to the Path variable to run idf.py and other tools.
3.4.2. Linux and MacOS
Add the following to ~/.profile:
export󰲧IDF_PATH=~/esp/esp-idf
export󰲧PATH="$IDF_PATH/tools:$PATH"
Run the following to check IDF_PATH:
printenv󰲧IDF_PATH
Run the following to check if idf.py is included in PAT:
which󰲧idf.py
It will print a path similar to ${IDF_PATH}/tools/idf.py.
You can also enter the following if you do not want to modify IDF_PATH or PATH:
export󰲧IDF_PATH=~/esp/esp-idf
export󰲧PATH="$IDF_PATH/tools:$PATH"!