macosarduinopath

exec: "python": executable file not found in $PATH on Arduino IDE


So I'm trying to run this really simple code on my LCD display, using an ESP32. When I compile the code in the Arduino IDE I get no errors. But, when I try to upload it, I get the following error:

exec: "python": executable file not found in $PATH
Error compiling for board DOIT ESP32 DEVKIT V1.

I'm running the Mac OS Monterey, on an M1 MacBook Air.

I did find some information here, but it wasn't what I was looking for, it was made for Ubuntu. I do have python3 installed on my Mac but it goes to /usr/bin/python3 and Mac automatically installs python, I want python3 to go to /usr/bin/python Running which python returns python not found which is weird, because python should be preinstalled on Mac. Any ideas how to fix this error, and is my way possible?

Thanks!


Solution

  • I encountered the same problem, but I solved it by executing the following command based on this issue.

    sed -i -e 's/=python /=python3 /g' ~/Library/Arduino15/packages/esp32/hardware/esp32/*/platform.txt

    https://github.com/espressif/arduino-esp32/issues/4717#issuecomment-1070801525