Arduino对ESP8266进行upload时报错

关键字:arduino、esp8266、esptool、pyserial、macos
时间:2021年10月

一、问题

Arduino对esp8266进行upload时,报错

pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch

二、解决办法

1、打开文件

~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py

2、注释掉29和30行

#iokit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('IOKit'))
#cf = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation'))

3、添加两行

iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit')
cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')