9

I am trying to write a basic keylogging program on python. I need to install the pywin32 and pyhook modules. I have managed to get pywin32 installed, but cannot seem to pyhook to work. I have read its possible to get it to work on later versions of python, but cannot seem to figure it out. I have tried both .exe and .whl installs. Using whl in cmd gives error that the wheel is not supported. Does anyone have a solution to install pyhook on python 3.5. Thanks

Vladamir
  • 247
  • 1
  • 3
  • 11
  • Are you sure you downloaded the right file? There are different ones for 32 bit installs and 64 bit installs. Just because your computer is 64 bit doesn't mean your python install is. – John Howard Feb 16 '16 at 05:27

2 Answers2

21

This is how I did it...

  1. Download the py hook module that matches your version of python from here. Make sure that if you have python 32 bit you download the 32 bit module (even if you have windows 64x) and vice versa.

  2. Open your command prompt and navigate to the folder where you downloaded the module

  3. Type "pip install " and then the name of the file.

    Ex: "pip install pyHook-1.5.1-cp27-none-win32.whl"

Note : you need pip

Community
  • 1
  • 1
staad
  • 796
  • 8
  • 20
  • Thanks @SUPERETDUPER. However it doesn't work. `C:\Python>python -V Python 3.5.1 C:\Python> C:\Python>pip install pyHook-1.5.1-cp27-cp27m-win32.whl pyHook-1.5.1-cp27-cp27m-win32.whl is not a supported wheel on this platform. C:\Python>pip install pyHook-1.5.1-cp27-none-win32.whl pyHook-1.5.1-cp27-none-win32.whl is not a supported wheel on this platform. C:\Python> C:\Python>pip install pyHook-1.5.1-cp37-cp37m-win32.whl pyHook-1.5.1-cp37-cp37m-win32.whl is not a supported wheel on this platform. C:\Python>` –  Mar 13 '18 at 21:20
  • 1
    @Sabrina You are using python 3.5 except the file you downloaded is for python 2.7 (hence the cp27 in its name). Make sure to download the file with cp35. – staad Mar 18 '18 at 21:47
2

If your pip install have not success. Try -> when you download a pyHook-1.5.1-cp27-none-win32.whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook After that move file to Programs\Python\Python35-32\Scripts path and then pip install pyHook-1.5.1-cp27-none-win32.whl I hope my answer is useful for you.

Fenx
  • 21
  • 1
  • Thanks but it doesn't work too `C:\Python>python -V Python 3.5.1 C:\Python> C:\Users\sabrina\AppData\Local\Programs\Python\Python35-32\Scripts>pip install pyHook-1.5.1-cp27-none-win32.whl pyHook-1.5.1-cp27-none-win32.whl is not a supported wheel on this platform. C:\Users\sabrina\AppData\Local\Programs\Python\Python35-32\Scripts>` –  Mar 13 '18 at 21:22