Problems importing python-Xlib

2020-06-08 06:43发布

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:

from Xlib.display import Display
ImportError: No module named Xlib.display

Where can I find this module that I am apparently lacking? Google yielded no leads.

"Edit: I already have that sourceforge module downloaded but I still get the same resutls.

8条回答
一纸荒年 Trace。
2楼-- · 2020-06-08 07:23

I was looking for the same answer, however after some more digging it seems that XCB (X protocol C-language Binding) will obsolete Xlib in general. From the XCB website:

The X protocol C-language Binding (XCB) is a replacement for Xlib featuring a small footprint, latency hiding, direct access to the protocol, improved threading support, and extensibility.

Fortunately there are python bindings available as python-xpyb in apt or xpyb on PyPi. I've not gotten that far in my project so I haven't tested if this works with Python3, but this is probably the way to go and the proper place to file any Python3 support bugs if necessary.

查看更多
再贱就再见
3楼-- · 2020-06-08 07:25

On Debian systems install python-xlib.

On other systems there's a high probability that the package carries the same name.

查看更多
登录 后发表回答