AttributeError:module 'esptool' has no attribute '_main'

hawk2003454
Posts: 1
Joined: Fri Nov 25, 2022 9:28 am

AttributeError:module 'esptool' has no attribute '_main'

Postby hawk2003454 » Fri Nov 25, 2022 9:33 am

用官方的blink_example_main.c 点灯,编译没问题,烧写时,出现:
Traceback (most recent call last):
File "d:\esp\esp-idf\components\esptool_py\esptool\esptool.py", line 22, in <module>
esptool._main() # type: ignore AttributeError:module 'esptool' has no attribute '_main'

打开esptool.py文件内容如下:
import os
import sys

try:
sys.path.remove(os.path.dirname(os.path.realpath(__file__))) # do not import this script
except ValueError:
pass

try:
import esptool
except ImportError:
raise ModuleNotFoundError('No module named "esptool" please install esptool.py by running '
'the install and export scripts.')

if __name__ == '__main__':
esptool._main() # type: ignore

请问各位大佬怎么处理这个错误,请问有官方的QQ群?很多问题百度不到,谢谢各位

Who is online

Users browsing this forum: No registered users and 59 guests