# Exec: "python": executable file not found in $PATH

**URL:** <https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847>\
**Category:** IDE 1.x\
**Created:** [March 21, 2022, 6:41pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847 "2022-03-21T18:41:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 21, 2022, 6:41pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/1 "2022-03-21T18:41:50Z")

</div>

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.

please help me out if you know the solution

Cheers, Loek

---

<div class="post-metadata">

**Author:** ![ZX80](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zx80/32/643687_2.png) [@ZX80](https://forum.arduino.cc/u/ZX80)\
**Post date:** [March 21, 2022, 8:26pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/2 "2022-03-21T20:26:44Z")

</div>

[https://forum.arduino.cc/t/mac-os-update-killed-esp32-sketch/969580/9](https://forum.arduino.cc/t/mac-os-update-killed-esp32-sketch/969580/9)

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [March 21, 2022, 9:02pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/3 "2022-03-21T21:02:28Z")

</div>

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".

---

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 22, 2022, 6:00am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/4 "2022-03-22T06:00:01Z")

</div>

Thank you!  
I tried this several times but it doesn't work in my case...

---

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 22, 2022, 6:00am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/5 "2022-03-22T06:00:49Z")

</div>

Thank you!  
Walked through the whole issue, but coudn't solve my problems....

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [March 22, 2022, 11:43am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/6 "2022-03-22T11:43:21Z")

</div>

> [@loekpfundt](#):
>
> I tried this several times but it doesn't work in my case...

Do you have Python 2 installed? What do the commands "which python" and "python -V" produce in Terminal?

---

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 23, 2022, 8:22am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/7 "2022-03-23T08:22:34Z")

</div>

python 3.10 is installed

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [March 23, 2022, 2:29pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/8 "2022-03-23T14:29:59Z")

</div>

That doesn't matter. Python 3 is "python3". You need "python" which is Python 2.

---

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 24, 2022, 11:44am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/9 "2022-03-24T11:44:33Z")

</div>

> [@johnwasser](#):
>
> which python

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

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [March 24, 2022, 1:05pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/10 "2022-03-24T13:05:41Z")

</div>

> [@loekpfundt](#):
>
> > [@johnwasser](#):
> >
> > which python
> 
> silly, but this command doesn't give an answer....

Sounds like you don't have Python 2 installed. You should install it.

> **[Python Releases for macOS](https://www.python.org/downloads/macos/)**
>
> The official home of the Python Programming Language

---

<div class="post-metadata">

**Author:** ![loekpfundt](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@loekpfundt](https://forum.arduino.cc/u/loekpfundt)\
**Post date:** [March 24, 2022, 1:26pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/11 "2022-03-24T13:26:47Z")

</div>

Alright, thnx!  
Starting to install python2

---

<div class="post-metadata">

**Author:** ![rhulett](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rhulett](https://forum.arduino.cc/u/rhulett)\
**Post date:** [April 12, 2022, 5:30am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/13 "2022-04-12T05:30:15Z")

</div>

Were you able to get it to work, @loekpfundt? I ran the OSX installer listed in post #10 but the IDE still failed with the same message:

`exec: "python": executable file not found in $PATH`  
`Error compiling for board Adafruit ESP32 Feather.`

Thanks.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [April 15, 2022, 4:17pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/14 "2022-04-15T16:17:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rhulett](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rhulett](https://forum.arduino.cc/u/rhulett)\
**Post date:** [April 15, 2022, 4:28pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/15 "2022-04-15T16:28:59Z")

</div>

Thanks. I landed on this solution. It feels imperfect, but I’m happy to be able to compile and push my code.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 24, 2022, 12:52pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/16 "2022-04-24T12:52:40Z")

</div>

running this command in Terminal.app under your current user

```plaintext
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

(cf [Deprecation of Python 2. Solution · Issue #4717 · espressif/arduino-esp32 · GitHub](https://github.com/espressif/arduino-esp32/issues/4717#issuecomment-1070801525))

---

<div class="post-metadata">

**Author:** ![strawbob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/strawbob/32/773593_2.png) [@strawbob](https://forum.arduino.cc/u/strawbob)\
**Post date:** [April 26, 2022, 2:09am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/17 "2022-04-26T02:09:33Z")

</div>

That worked for me. Thanks very much!!!!

---

<div class="post-metadata">

**Author:** ![ayushkhandelwal](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@ayushkhandelwal](https://forum.arduino.cc/u/ayushkhandelwal)\
**Post date:** [April 26, 2022, 9:17am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/18 "2022-04-26T09:17:05Z")

</div>

It worked for me too 😀

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 27, 2022, 10:23pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/19 "2022-04-27T22:23:39Z")

</div>

Glad it helped!

---

<div class="post-metadata">

**Author:** ![kgray9](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kgray9/32/671408_2.png) [@kgray9](https://forum.arduino.cc/u/kgray9)\
**Post date:** [May 28, 2022, 5:40pm UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/20 "2022-05-28T17:40:58Z")

</div>

Awesome!

I just spent 4 hours trying to fix this very problem. I just tried your suggestion, and it worked for me too!  
Thanks @J-M-L

---

<div class="post-metadata">

**Author:** ![timath98](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@timath98](https://forum.arduino.cc/u/timath98)\
**Post date:** [June 10, 2022, 9:15am UTC](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847/21 "2022-06-10T09:15:38Z")

</div>

This worked for me too 🙌🏽

[Next page](https://forum.arduino.cc/t/exec-python-executable-file-not-found-in-path/971847.md?page=2)
