import pyHook failed
Asked Answered
T

1

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
>>>  
Tomtom answered 7/9, 2015 at 21:17 Comment(4)
What does import sys and then sys.path tell you? Is C:\Python27\Lib\site-packages listed there?Kokura
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 isTomtom
How did you install pyHook on 64-bit Python? It seems the latest build has 32-bit only installers: sourceforge.net/projects/pyhook/files/pyhook/1.5.1 Did you get it from another source?Stead
For pure Python I would recommend hooked: github.com/IronManMark20/pyhooked It's for keyboard hooks only. But you don't need any binaries like .pyd files in pyHook.Stead
V
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!

Vtol answered 31/1, 2016 at 20:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.