安装dbus-python的简要教程

yipeiwu_com5年前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中数据解析

Import os; -- Python自带 print(os.getcwd()) -- 获得当前工作目录 os.chdir('/Users/longlong/Documents') -...

Python 文件操作技巧(File operation) 实例代码分析

常用的module是 os ,os.path 和shutil,所以要先引入他们. python遍历文件夹和文件 这个也许是最常用的功能,如下: 复制代码 代...

django2用iframe标签完成网页内嵌播放b站视频功能

django2用iframe标签完成网页内嵌播放b站视频功能

前言: 给自己的网站中加入视频资源,有两种方法,一种是用iframe标签引用外站资源,另一种则使用video标签,获取站内资源进行视频播放。其中前者顾名思义,是将视频资源上传到视频网站...

Python中的魔法方法深入理解

接触Python也有一段时间了,Python相关的框架和模块也接触了不少,希望把自己接触到的自己 觉得比较好的设计和实现分享给大家,于是取了一个“Charming Python”的小标,...

Python正则获取、过滤或者替换HTML标签的方法

本文实例介绍了Python通过正则表达式获取,去除(过滤)或者替换HTML标签的几种方法,具体内容如下 python正则表达式关键内容: python正则表达式转义符: . 匹配除...