本文介绍了导入python-Xlib时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了一个新模块,似乎没有安装它的依赖项之一.该模块称为Xlib.display.这是我收到的错误消息:

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

在哪里可以找到我显然缺少的模块? Google没有线索.

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

我已经下载了sourceforge模块,但仍然得到相同的结果.

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

推荐答案

请尝试.

这将安装Xlibsudo apt-get install python-xlib

然后您可以检查

>>from Xlib.display import Display

如果要控制和捕获鼠标事件,要安装PyMouse,请使用:

To install PyMouse if you want to control and capture mouse events please use:

sudo easy_install https://github.com/pepijndevos/PyMouse/zipball/master

这篇关于导入python-Xlib时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 19:57