Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

python - PYINSTALLER FAILED TO EXECUTE SCRIPT (used pynput)

Recently, I have installed pyinstaller 4.2.

This is the error I get after running the script from cmd:

Traceback (most recent call last):

File "Keylogger.py", line 1, in <module>

File "PyInstallerloaderpyimod03_importers.py", line 359, in exec_module

File "pynput\__init__.py", line 40, in <module>

File "PyInstallerloaderpyimod03_importers.py", line 359, in exec_module

File "pynputkeyboard\__init__.py", line 31, in <module>

File "pynput\_util\__init__.py", line 76, in backend

ImportError

[41576] Failed to execute script Keylogger

The command I used to convert to .exe is "pyinstaller --onefile Keylogger.exe"

I am a beginner coder so I don't understand what the error actually is. Can anyone pls help me? Thank you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try running the below command.

pyinstaller --onefile Keylogger.py

Your python file ends with .py extension.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...