How to Control your Keyboard in Python To make this work: pip3 install -r requirements.txt And run the lines of code in control_keyboard.py individually, that's because it makes no sense to run them at once.