安装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简单实现socket信息发送与监听功能示例

本文实例讲述了Python简单实现socket信息发送与监听功能。分享给大家供大家参考,具体如下: 最近在研究boost C++库,用于工作中处理大规模高并发TCP连接数据响应,想测试,...

python通过函数属性实现全局变量的方法

本文实例讲述了python通过函数属性实现全局变量的方法。分享给大家供大家参考。具体分析如下: python的函数可以定义属性,而且是全局的,这个非常好用,例如用于数字累加,你不用专门去...

Python运算符重载详解及实例代码

Python运算符重载       Python语言提供了运算符重载功能,增强了语言的灵活性,这一点与C++有点类似又有些不同。鉴于它的...

python实现系统状态监测和故障转移实例方法

复制代码 代码如下:#coding: utf-8import socketimport selectimport timeimport osimport threading def se...

mac系统安装Python3初体验

前沿 对于iOS开发不要随便拆卸系统自带的Python,因为有很多 library 还是使用 Python2.7。 1 安装Xcode 1.1 App Store 搜索Xcode 并安装...