Search code examples
pythonarduino-esp32

exec: "python": executable file not found in $PATH


since the last update to Mac OS Monterey 12.3 I get the following error message when compiling my Arduino sketch:

exec: "python": executable file not found in $PATH

Unfortunately, I have not yet been able to find out how to solve this problem.

I would be very grateful for ideas and suggestions.


Solution

  • Problem

    In MacOS 12.3 Apple removed python2.7 (python) from MacOS.

    Solution

    What I did to solve this is link python3 to python, I wouldn't recommend it because it's sus, I would recommend you wait until Arduino IDE fixes this issue in a later build. For the time being, you could try their Web IDE: Arduino Editor

    However, here are the instructions to link python3 to python:

    1. If you don't have python3 installed, install it here in the link below:

      Python Install Page

    2. Find your path for the current version of python3 you're using

      which python3

      it'll show up with something like this: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3

    3. Copy that and use it to run this command that links python 3 to python. Replace the first file path with where your python3 is.

      ln -s -f INSERT_PATH_OF_PYTHON3 /usr/local/bin/python

      for example:

      ln -s -f /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 /usr/local/bin/python