Ask coding questions

← Back to all posts
How do I get pynput to work?
TurtleAndrew (63)

Please tell me why it gives me an error message every time I run it. Also, I tried both python 2 and 3. I also tried to download Xlib and import it to fix the problem along with even trying to make a display. It didn't work. Heres the error message it gave me:

Commentshotnewtop
AnthonyFerr (2)

I had to pip install xlib then pip3 install pynput for it to work, and I wasn't even using replit. It's doubtful that a browser environment will ever be able to use this module.

TurtleAndrew (63)

@AnthonyFerr I think so to. But still, there could be a way but I'm doubtful there is.

Nettakrim (388)

i think its due to not having a screen try useing pygame not python

Lucas_Williams (0)

I have the same question. ^^

TurtleAndrew (63)

@Lucas_Williams IDK but I do think using the pygame language will work.

TurtleAndrew (63)

@Lucas_Williams In that case, it might just not work on repl. If you tell me what your trying to do with it, I might be able to tell you a different way to do it or a different package to use.

Lucas_Williams (0)

@TurtleAndrew I’m trying to have a program force me to type letters. So I start it type in a letter and a number and wherever my cursor is it types that character however many times I set it to. I tried it on python on my PC and i can get it to work was just hoping it would work on repl as well.

TurtleAndrew (63)

@Lucas_Williams Ok, I just don't think pynput will work on repl.