資料來源:
1. https://forum.arduino.cc/t/esp32-problem-with-compilation-on-macos-12-3-monterey/969771
2. https://forum.arduino.cc/t/mac-os-update-killed-esp32-sketch/969580/8
作者:順哥
email:palmbear@gmail.com
Table of Contents
[TOC]
前言
最近新購買2021 Macbook Pro 14吋 使用 Arduino IDE 1.18.9 在ESP32開發板上傳程式碼時,發生 「exec: “python": executable file not found in $PATH’」錯誤。上網查了發現解決方法,留下紀錄,以免後續再碰到時,不知如何解決。
問題
ESP32: problem with compilation on MacOS 12.3 Monterey
問題頁面 。
網頁畫面:
解決方法
網頁畫面:
我的解決方法
我按照網頁上的解決方法,更改
/Users/palmbearhung/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/platform.txt 文件內容:
# From
tools.gen_esp32part.cmd=python "{runtime.platform.path}/tools/gen_esp32part.py"
# To
tools.gen_esp32part.cmd=/usr/local/bin/python "{runtime.platform.path}/tools/gen_esp32part.py"
但是還時不能上傳!!!
Arduino IDE跟我說「no such file or directory」
將 python 更改為 python3 也不行!!!
這倒底是怎麼一回事呢?
後來把整個文章看完,才知道也有人跟我一樣。
但是有解決方法,就是:
找出 python3放在電腦的哪個位置?
使用 which python3 指令,找出 python3 的所在位置。

原來我的 python3 位置跟他們的不一樣!

更改完成後,儲存檔案。
再次上傳檔案,成功!!!

