I installed a new module and it appears as if one of its dependencies was not already installed. The module is called Xlib.display. Here is the error message I received:
Below worked for me!
pip install python3_xlib
I have also used pyuserinput for automation which requires this.
I don't think the Xlib library works in Python 3.
Source:
Requirements
The Python X Library requires Python 1.5.2 or newer. It has been tested to various extents with Python 1.5.2 and 2.0 through 2.6.