Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NameError: name 'keyboard' is not defined" 😬. what to do? #37

Open
charan-24 opened this issue Nov 22, 2022 · 8 comments
Open

"NameError: name 'keyboard' is not defined" 😬. what to do? #37

charan-24 opened this issue Nov 22, 2022 · 8 comments

Comments

@charan-24
Copy link

Getting an Error like this:

Traceback (most recent call last):
  File "/workspace/Keylogger/keylogger.py", line 144, in <module>
    keylogger.run()
  File "/workspace/Keylogger/keylogger.py", line 116, in run
    keyboard_listener = keyboard.Listener(on_press=self.save_data)
NameError: name 'keyboard' is not defined

What to do?

@aydinnyunus
Copy link
Owner

can you install requirements.txt and try again ? I updated the requirements.txt

@charan-24
Copy link
Author

charan-24 commented Nov 22, 2022

Yes, I have Installed "pillow" module also
Pillow in /workspace/.pyenv_mirror/user/current/lib/python3.8/site-packages (9.3.0)

But got the same error on "keyboard" as mentioned earlier.

@CrippledToenail
Copy link

Same

@Heyiamslice
Copy link

@Reavx
Copy link

Reavx commented Feb 13, 2023

Getting an Error like this:

Traceback (most recent call last):
  File "/workspace/Keylogger/keylogger.py", line 144, in <module>
    keylogger.run()
  File "/workspace/Keylogger/keylogger.py", line 116, in run
    keyboard_listener = keyboard.Listener(on_press=self.save_data)
NameError: name 'keyboard' is not defined

What to do?

hey men what did u do u solve that problem?

@psusmit
Copy link

psusmit commented Jul 1, 2023

On line 116 this error occured, but if we check in import we have Listener so try replacing the line with:
keyboard_listener = Listener(on_press=self.save_data)
Also try import this statement on line 115 just before it:
from pynput.keyboard import Listener

@mikethemelon
Copy link

Maybe bc you doesn't have all the requirements, try to pip install every library is needed by manual

@lAnviuml
Copy link

lAnviuml commented Apr 8, 2024

I have the same thing
Traceback (most recent call last): File "P:\My Documents\keylogger\Keylogger-master\Keylogger-master\keylogger.py", line 143, in <module> keylogger.run() File "P:\My Documents\keylogger\Keylogger-master\Keylogger-master\keylogger.py", line 115, in run keyboard_listener = Listener(on_press=self.save_data) ^^^^^^^^ NameError: name 'Listener' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants