6

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
>>>  
Danny Rock
  • 89
  • 1
  • 2
  • 12
  • What does `import sys` and then `sys.path` tell you? Is C:\Python27\Lib\site-packages listed there? – haraldkl Sep 07 '15 at 21:54
  • Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on wi n32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', 'C:\\Windows\\SYSTEM32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\ \lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27 ', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\win32' , 'C:\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\Python27\\lib\\site-packa ges\\Pythonwin'] >>> Yes there is – Danny Rock Sep 08 '15 at 08:04
  • How did you install pyHook on 64-bit Python? It seems the latest build has 32-bit only installers: https://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/ Did you get it from another source? – Vasily Ryabov Oct 01 '15 at 14:36
  • 1
    For pure Python I would recommend `hooked`: https://github.com/IronManMark20/pyhooked It's for keyboard hooks only. But you don't need any binaries like .pyd files in pyHook. – Vasily Ryabov Oct 01 '15 at 14:40

1 Answers1

7

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!

staad
  • 796
  • 8
  • 20