I have installed python3.8.2 with pip3 version 20.01 and pynput version 1.6.8 is also installed and configured.
OS used is Windows
IDE: PyCharm
launch file on: PyCharm run
import pynput.keyboard
def process_key_press(key):
print(key)
keyboard_listener = pynput.keyboard.Listener(on_press=process_key_press)
with keyboard_listener:
keyboard_listener.join()
Error there is error in:
import pynput.keyboard
PyCharm creates a new virtual environment for each project by default. You have two choices:
Select a "System interpreter" for a project, which will use your global environment. See here for more info: Configure a Python interpreter
Install pynput using pip in the venv using the terminal embedded in PyCharm