The line `from tkinter import W` is useless, because `W` is never used. https://github.com/python-xlib/python-xlib/blob/333fbcbc93501c86d84a70d704746360ee640dff/Xlib/ext/randr.py#L37 Removing the unnecessary import allows running even when python is built without TCL/TK support.