pyinstaller로 exe파일 생성시 생기는 failed to execute script 에러 관련

조회수 82회

pycharm을 통해 kellog.py프로그램이 잘 실행된다는 걸 확인하고 pyinstaller로 exe파일을 만들기 위해서 실행을 하자 failed to execute script 오류가 발생했습니다.

콘솔창은 아래와 같이 나왔습니다.

pyinstaller --onefile --noconsole kellog.py
75 INFO: PyInstaller: 4.0
75 INFO: Python: 3.8.5
80 INFO: Platform: Windows-10-10.0.18362-SP0
82 INFO: wrote C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\kellog.spec
85 INFO: UPX is not available.
87 INFO: Extending PYTHONPATH with paths
['C:\\Users\\JoSP\\PycharmProjects\\untitled1\\Xelogger-master',
 'C:\\Users\\JoSP\\PycharmProjects\\untitled1\\Xelogger-master']
96 INFO: checking Analysis
210 INFO: checking PYZ
239 INFO: checking PKG
313 INFO: Building because C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\build\kellog\kellog.exe.manifest changed
313 INFO: Building PKG (CArchive) PKG-00.pkg
2548 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
2585 INFO: Bootloader c:\users\josp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
2585 INFO: checking EXE
2596 INFO: Rebuilding EXE-00.toc because pkg is more recent
2596 INFO: Building EXE from EXE-00.toc
2602 INFO: Updating manifest in C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\build\kellog\runw.exe.s84gl9ub
2604 INFO: Updating resource type 24 name 1 language 0
2617 INFO: Appending archive to EXE C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\dist\kellog.exe
2626 INFO: Building EXE from EXE-00.toc completed successfully.

이렇게 만들어진 파일을 실행하면 failed to execute script 오류가 발생하고,

pyinstaller --onefile kellog.py 로 exe파일을 만들면

72 INFO: PyInstaller: 4.0
72 INFO: Python: 3.8.5
74 INFO: Platform: Windows-10-10.0.18362-SP0
75 INFO: wrote C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\kellog.spec
79 INFO: UPX is not available.
82 INFO: Extending PYTHONPATH with paths
['C:\\Users\\JoSP\\PycharmProjects\\untitled1\\Xelogger-master','C:\\Users\\JoSP\\PycharmProjects\\untitled1\\Xelogger-master']
91 INFO: checking Analysis
205 INFO: checking PYZ
232 INFO: checking PKG
307 INFO: Building because C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\build\kellog\kellog.exe.manifest changed
307 INFO: Building PKG (CArchive) PKG-00.pkg
2538 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
2567 INFO: Bootloader c:\users\josp\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
2567 INFO: checking EXE
2578 INFO: Building because console changed
2578 INFO: Building EXE from EXE-00.toc
2582 INFO: Updating manifest in C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\build\kellog\run.exe.81311ebh
2583 INFO: Updating resource type 24 name 1 language 0
2596 INFO: Appending archive to EXE C:\Users\JoSP\PycharmProjects\untitled1\Xelogger-master\dist\kellog.exe
2606 INFO: Building EXE from EXE-00.toc completed successfully.```

콘솔창에 이렇게 나오고

kellog.exe 파일을 실행하면 콘솔창에

Traceback (most recent call last):
File "kellog.py", line 8, in <module>
File "c:\users\josp\appdata\local\programs\python\python38-32\lib\site-packages\Pyinstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__) File "pynput\__init__.py", line 40, in <module>
File "c:\users\josp\appdata\local\programs\python\python38-32\lib\site-packages\Pyinstaller\loader\pyimod03_importers.py", line 493, in exec_module
 exec(bytecode, module.__dict__)
File "pynput\keyboard\__init__.py", line 31, in <module>
File "pynput\_util\__init__.py", line 76, in back end
ImportError
[25856] Failed to execute script kellog

라고 뜨면서 콘솔이 바로 종료가 됩니다. 어떻게 해결해야 할까요 ㅠ

답변을 하려면 로그인이 필요합니다.

Hashcode는 개발자들을 위한 무료 QnA 사이트입니다. 계정을 생성하셔야만 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)

ᕕ( ᐛ )ᕗ
로그인이 필요합니다

Hashcode는 개발자들을 위한 무료 QnA사이트 입니다. 계정을 생성하셔야만 글을 작성하실 수 있습니다.