"python3": executable file not found in $PATH

This is evidently an error many people get. I have Python 3 installed on my Mac, but I can only access it if I launch Arduino from within Terminal. The forum at Adafruit was unable to resolve this and suggested I ask the Arduino forum. Is there any resolution available?

exec: "python3": executable file not found in $PATH
Error compiling for board Adafruit Feather ESP32-S2.

Arduino: 1.8.19 (Mac OS X), Board: "Adafruit Feather ESP32-S2, Enabled, Disabled, Disabled, Internal USB, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None"

see Exec: "python": executable file not found in $PATH - #16 by J-M-L

After posting this question I was shown an existing thread on the same issue. I've tried the various solutions offered with no success. The following command was listed in another thread, but I can't find that thread again. I hate to enter Terminal commands having no idea what they do or change. What all is this doing to my machine?

sudo usermod -a -G dialout $USER && sudo apt-get install git && wget https://bootstrap.pypa.io/get-pip.py && sudo python3 get-pip.py && sudo pip3 install pyserial && mkdir -p ~/Arduino/hardware/espressif && cd ~/Arduino/hardware/espressif && git clone GitHub - espressif/arduino-esp32: Arduino core for the ESP32 esp32 && cd esp32/tools && python3 get.py

are you on a Mac or using Linux ??

J-M-L Your solution is one that I tried with no effect. I just tried it again, with no change.

On my Mac

which version of the IDE are you running ?

did you install the ESP32 environment correctly ?

then go to the board manager and install the ESP32 environment

then once this is installed, open terminal and run the unix command as is (just one line)

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

Do you have Python 3 installed? You can install from Download Python | Python.org

I installed the ESP32 environment correctly.
I used the same link you suggest for the Board Manager.
I ran the sed command you provided in Terminal as one line and it returns with no error.
I still get the $PATH error.

I do have Python 3 installed. If I enter "which python3" in Terminal I get:

/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

which macOS version are you running?

I'm running OS X Mojave, 10.14.6.

The error message actually has another comment, in case this matters. The full message is:

Multiple libraries were found for "WiFi.h"
Used: /Users/bryan/Library/Arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/WiFi
Not used: /Applications/ Bryan's/Arduino/Arduino 1.8.19.app/Contents/Java/libraries/WiFi
exec: "python3": executable file not found in $PATH
Error compiling for board Adafruit Feather ESP32-S2.

my python install is

> which python3
/usr/bin/python3

OS X Mojave is from 2018.... the command works on recent OS version where Python2 is deprecated

if your Mac can upgrade to Monterey, you should consider that.

Monterey .... someday I will have to. But when I do, many of my programs will no longer run. I am not prepared to lose all of that yet.

I'm in the exact same predicament. running macos 10.14 with older software I'm not ready to give up.

Have you tried the online compiler? https://create.arduino.cc/editor Its not the same as running locally, but it works.

clearly the IDE is not looking for Python3 in your special directory

may be you could create a link/alias (using ln) from /usr/bin/python3 to /Library/Frameworks/Python.framework/Versions/3.5/bin/python3

Thanks for your patience in trying to solve my problem. I have a virtual instance of MacOS Monterey running under Parallels. I just installed Arduino on it, and the necessary libraries, and it compiles without error. But, for reasons unknown, it runs as slow as molasses and is unworkable. This seems to explain the problem. Some things won't run on the new OS, some things won't run on the old.

I have never tried the online compiler. I just had a look. It doesn't seem so bad except that several of the projects in my Projects folder to not appear in the Upload window. And the project I'm struggling with is one of them. Some things won't run on the new OS, some things won't run on the old, and some things won't run on the online compiler!

It works great on my Mac… probably due to the performance of your underlying Mac

executing this line worked for me. Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.