After updating my Macbook Air into MacOS Monterey 12.3 I get an error "exec: "python": executable file not found in $PATH" when compiling my script. I checked the right python version in the right folder and that is okay. Did several restarts and installed IDE latest version on my Macbook. Still not disappeared.
Starting the IDE with the Terminal app works for me:
open /Applications/Arduino1.8.19.app
Termial has command completion so you can type: open /App[TAB]
Terminal will expand that to: open /Applications/
You then type Ard[TAB] and that will get expanded to whatever app you have that starts with "Ard".
silly, but this command doesn't give an answer....
when I use which python3 I get te following result
Library/Frameworks/Python.framework/Versions/3.10/bin/python3
There is a problem somewhere that keeps the Python 2 install from being on the search path when Arduino is started from Finder. Starting Arduino from Terminal works around the problem.
running this command in Terminal.app under your current user
sed -i -e 's/=python /=python3 /g' ~/Library/Arduino15/packages/esp32/hardware/esp32/*/platform.txt
seems to fix it.The command modifies all the platform.txt files under your local installation of the ESP32 tools (~/Library/Arduino15/packages/esp32/hardware/esp32) and replaces the word python by python3 wherever it finds it