0

I'm trying to make a program in which I need to emulate a key press from a gamepad, I looked for it a lot but the only module I found is python-evdev. I have tried to install it through the use of

pip install evdev

but there isn't any matching version. Also I have tried to download the module and manually move it into the site-packages folder (I have no idea if this is correct or not) but when i try to import the module i get this error:

ImportError: cannot import name '_ecodes' from partially initialized module 'evdev' (most likely due to a circular import).

Is there something I did wrong or maybe is there another library which does the same thing?

Vaebhav
  • 4,672
  • 1
  • 13
  • 33
M4tt3.exe
  • 3
  • 4
  • does this answer your question ? https://stackoverflow.com/questions/64807163/importerror-cannot-import-name-from-partially-initialized-module-m – Shabari nath k Feb 21 '21 at 14:07
  • yeah actually I had already done some researches about this error but since it's raised inside the module i thought there was something wrong about how I installed it. At this point I will see if I can correct the module. Also here's where I downloaded the module https://files.pythonhosted.org/packages/4d/ec/bb298d36ed67abd94293253e3e52bdf16732153b887bf08b8d6f269eacef/evdev-1.4.0.tar.gz – M4tt3.exe Feb 21 '21 at 16:04
  • UPDATE: I've moved to my virtual machine on linux and installed the package there, pip has automatically installed it inside the 'Python3.8' folder, the code was the exact same but when I imported the lib, no error showed up. Then I've tried to move the lib inside 'Python3.9' folder and the exact same error was raised. I guess this has something to do with some changes in how circular import works with python3.9. – M4tt3.exe Feb 22 '21 at 07:56

0 Answers0