I am just setting up for an ESP32-S2 Feather under Arduino 1.8.19 on a Mac. Blink tells me "exec: "python3": executable file not found in $PATH".
Any advice?
"python3": executable file not found in $PATH
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
- sj_remington
- Posts: 997
- Joined: Mon Jul 27, 2020 4:51 pm
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
Thanks for the effort. It didn't help.sj_remington wrote:This may be relevant:
https://forum.arduino.cc/t/python-execu ... le/1008150
- sj_remington
- Posts: 997
- Joined: Mon Jul 27, 2020 4:51 pm
Re: "python3": executable file not found in $PATH
Do you have python3 installed?
If so, where, and where is the IDE looking for it? Post the complete error message.
If so, where, and where is the IDE looking for it? Post the complete error message.
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
I can execute Python3 from Terminal.sj_remington wrote:Do you have python3 installed?
If so, where, and where is the IDE looking for it? Post the complete error message.
The complete error message is:
exec: "python3": executable file not found in $PATH
Error compiling for board Adafruit Feather ESP32-S2.
I believe my Python2 is at "/usr/bin/python"
and Python3 is at "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"
If I enter Arduino through Terminal I don't get the error message.
- sj_remington
- Posts: 997
- Joined: Mon Jul 27, 2020 4:51 pm
Re: "python3": executable file not found in $PATH
Consider adding the python3 executable location to the $PATH variable.
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
I would love to do that, but I have no idea how to access $PATH in the Arduino app.sj_remington wrote:Consider adding the python3 executable location to the $PATH variable.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: "python3": executable file not found in $PATH
Apple removed Python-2 in macOS 12.2 because it's officially deprecated and abandoned, and doesn't install Python3 by default.
What output do you get from:
What output do you get from:
Code: Select all
which python python3
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
/usr/bin/python
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
I can execute Python 3.5.2.
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
I can execute Python 3.5.2.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
ls -l /usr/bin/py*
-rwxr-xr-x 4 root wheel 925 Feb 25 2019 /usr/bin/pydoc
lrwxr-xr-x 1 root wheel 74 Mar 15 2019 /usr/bin/pydoc2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7
-rwxr-xr-x 1 root wheel 66880 Sep 20 2019 /usr/bin/python
-rwxr-xr-x 4 root wheel 925 Feb 25 2019 /usr/bin/python-config
lrwxr-xr-x 1 root wheel 75 Mar 15 2019 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82 Mar 15 2019 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x 1 root wheel 66880 Sep 20 2019 /usr/bin/pythonw
lrwxr-xr-x 1 root wheel 76 Mar 15 2019 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
I might point out that other people have the same error, and ask about it online. Sometimes people say a proposed solution works, sometimes it doesn't. The only one that worked for me was to launch Arduino from within Terminal. The following one worked for some people, but not me:
sed -i -e 's/=python /=python3 /g' ~/Library/Arduino15/packages/esp32/hardware/esp32/*/platform.txt
-rwxr-xr-x 4 root wheel 925 Feb 25 2019 /usr/bin/pydoc
lrwxr-xr-x 1 root wheel 74 Mar 15 2019 /usr/bin/pydoc2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7
-rwxr-xr-x 1 root wheel 66880 Sep 20 2019 /usr/bin/python
-rwxr-xr-x 4 root wheel 925 Feb 25 2019 /usr/bin/python-config
lrwxr-xr-x 1 root wheel 75 Mar 15 2019 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82 Mar 15 2019 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x 1 root wheel 66880 Sep 20 2019 /usr/bin/pythonw
lrwxr-xr-x 1 root wheel 76 Mar 15 2019 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
I might point out that other people have the same error, and ask about it online. Sometimes people say a proposed solution works, sometimes it doesn't. The only one that worked for me was to launch Arduino from within Terminal. The following one worked for some people, but not me:
sed -i -e 's/=python /=python3 /g' ~/Library/Arduino15/packages/esp32/hardware/esp32/*/platform.txt
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: "python3": executable file not found in $PATH
I've been working my way to a more general and durable solution.
What do you get from:
If it's some version of Python-3, enter:
If it's some version of Python-2, enter:
What do you get from:
Code: Select all
/usr/bin/python --version
Code: Select all
sudo ln -s /usr/bin/python /usr/bin/python3
Code: Select all
sudo ln -s `which python3` /usr/bin/python3
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
Thanks for your efforts. No luck yet:
sudo ln -s `which python3` /usr/bin/python3
Password:
ln: /usr/bin/python3: Operation not permitted
(I entered my password)
sudo ln -s `which python3` /usr/bin/python3
Password:
ln: /usr/bin/python3: Operation not permitted
(I entered my password)
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: "python3": executable file not found in $PATH
Ah.. right. MacOS has security rules that don't allow changes in certain key directories. /usr/bin is one of them.
Try:
The /usr/local file tree isn't locked out.
Try:
Code: Select all
sudo sh -c "ln -s `which python3` /usr/local/bin/python3"
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: "python3": executable file not found in $PATH
You are persistent! Thank you. But, no luck.
sudo sh -c "ln -s `which python3` /usr/local/bin/python3"
Password:
ln: /usr/local/bin/python3: File exists
Still failure to compile with the following error, but I can still compile if I launch Arduino from within Terminal.
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.
sudo sh -c "ln -s `which python3` /usr/local/bin/python3"
Password:
ln: /usr/local/bin/python3: File exists
Still failure to compile with the following error, but I can still compile if I launch Arduino from within Terminal.
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.
Please be positive and constructive with your questions and comments.