import pyHook failed

Danny Rock picture Danny Rock · Sep 7, 2015 · Viewed 15.6k times · Source

I Have installed pyHook for my windows 64 bit.The setup has installed it in C:\Python27\Lib\site-packages dir i cant import pyhook (i can see win32 named folder there think so it is its folder) in my code what should i do Here is interpreters output

>>> import pyHook

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pyHook
ImportError: No module named pyHook
>>> import pyhook

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import pyhook
ImportError: No module named pyhook
>>>  

Answer

staad picture staad · Jan 31, 2016

First of all win32 is not the pyHook module it is an other module.

Here is how to install pyHook:

1.You can find the download link here http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook

2.If you have python 32bit you want pyhook 32 bit (Download #1 for Python 2.7).

3.If you have python 64bit you want pyHook 64 bit (Download #2 for Python 2.7).

4.Extract the zip file.

5.In the command prompt navigate to the folder where you extracted the .zip.

6.Type the command 'pip install pyHook-1.5.1-cp27-none-win32.whl' for the 32 bit version or 'pip install pyHook-1.5.1-cp27-none-win_amd64.whl'

Good Luck!