2015-09-07 17 views
5

Ho installato pyHook per i miei Windows 64 bit. L'installazione l'ha installato in C: \ Python27 \ Lib \ site-packages dir non posso importare pyhook (posso vedere Win32 cartella denominata lì pensa così è il suo cartella) nel mio codice che cosa devo fare Ecco uscita interpretiimportazione pyHook fallita

>>> 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 
>>> 
+0

Che cosa significa "importa sys" e "sys.path"? C: \ Python27 \ Lib \ site-packages è elencato qui? – haraldkl

+0

Python 2.7.10 (predefinito, 23 maggio 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] su wi n32 Digitare "help", "copyright", "credits" o "license" per maggiori informazioni. >>> import sys >>> sys.path ['', 'C: \\ Windows \\ SYSTEM32 \\ python27.zip', 'C: \\ Python27 \\ DLL', '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 '] >>> Sì, c'è –

+0

Come hai installato pyHook su Python 64-bit? Sembra che l'ultima build abbia solo installer a 32 bit: https://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/ L'hai presa da un'altra fonte? –

risposta

6

Prima di tutto win32 non è il modulo pyHook si tratta di un altro modulo.

Ecco come installare pyHook:

1.You può trovare il link per il download qui http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook

2.Se sono python 32bit si vuole pyhook a 32 bit (Scarica # 1 per Python 2.7) .

3.Se si dispone di Python 64 bit, si desidera pyHook 64 bit (Download # 2 per Python 2.7).

4. Estrai il file zip.

5. Nel prompt dei comandi, accedere alla cartella in cui è stato estratto .zip.

6. Digitare il comando "pip installa pyHook-1.5.1-cp27-none-win32.whl" per la versione a 32 bit o "pip installa pyHook-1.5.1-cp27-none-win_amd64.whl"

Buona fortuna!