Page 1 of 1

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

Posted: Fri Nov 25, 2022 9:33 am
by hawk2003454
用官方的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群?很多问题百度不到,谢谢各位