1. pyinstall.exe -F main.py 실행해서 spec파일 생성
2. spec 파일에 아래와 같이 추가
datas=[
[
"C:\\Python311\\Lib\\site-packages\\autoit\\lib\\AutoItX3_x64.dll",
"autoit\\lib"
]
],
hiddenimports=["autoit.init", "autoit.autoit", "autoit.control",
"autoit.process", "autoit.win"],
3. pyinstall.exe main.spec 실행
참조
https://stackoverflow.com/questions/59190771/pyinstaller-oserror-cannot-load-autoitx-from-path