I have installed pynput module. But when I do import pynput , it shows the error given in the title.
Here is the screenshot, showing successful installation of pynput module
51 Answer
As you see in your screen output, pip install will install packages for Python version 2.x. However, you are probably using Python version 3.x. The pip man page specifies:
On Debian, pip is the command to use when installing packages for Python 2, while pip3 is the command to use when installing packages for Python 3.
So, you should use:
pip3 install pynputto install packages for Python version 3.x.
I hope Python 2.x will be removed completely from Ubuntu versions released in 2020 and forward. And such misunderstandings will be eliminated too!