安装dbus-python的简要教程

yipeiwu_com6年前Python基础

写一个 python 脚本需要用到 dbus,但因为 dbus-python 这个包并没有提供 setup.py , 所以无法通过 pip 直接安装,唯有下载源码手动编译安装一途了。

wget https://pypi.python.org/packages/source/d/dbus-python/dbus-python-0.84.0.tar.gz
tar zxvf dbus-python-0.84.0.tar.gz
cd dbus-python-0.84.0

但事有不顺,在 ./configure 的过程中,还是出了一些错。

configure: error: Package requirements (dbus-1 >= 1.0) were not met:

No package 'dbus-1' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables DBUS_CFLAGS
and DBUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

这显然是缺失了依赖库

sudo apt-get install libdbus-glib-1-dev

然后安装就就可以顺利进行了

./configure
make
sudo make install


相关文章

详解Python中打乱列表顺序random.shuffle()的使用方法

之前自己一直使用random中 randint生成随机数以及使用for将列表中的数据遍历一次。 现在有个需求需要将列表的次序打乱,或者也可以这样理解: 【需求】将一个容器中的数据每次...

opencv调整图像亮度对比度的示例代码

opencv调整图像亮度对比度的示例代码

图像处理 图像变换就是找到一个函数,把原始图像矩阵经过函数处理后,转换为目标图像矩阵.   可以分为两种方式,即像素级别的变换和区域级别的变换 Point operators (p...

Python 3.6 中使用pdfminer解析pdf文件的实现

Python 3.6 中使用pdfminer解析pdf文件的实现

所使用python环境为最新的3.6版本 一、安装pdfminer模块 安装anaconda后,直接可以通过pip安装 pip install pdfminer3k  ...

Python模块WSGI使用详解

WSGI(Web Server Gateway Interface):Web服务网关接口,是Python中定义的服务器程序和应用程序之间的接口。 Web程序开发中,一般分为服务器程序和...

python多个模块py文件的数据共享实例

模块a.py 想用 b.py中公有数据 cnt b的python文件 #!/usr/bin/env python # coding:utf8 from wx import Cal...