安装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使用turtle绘制国际象棋棋盘

python使用turtle绘制国际象棋棋盘

本文实例为大家分享了python使用turtle画国际象棋棋盘的具体代码,供大家参考,具体内容如下 使用的方法是每一个小格每一个小格的画 import turtle for i in...

python异步实现定时任务和周期任务的方法

一. 如何调用 def f1(arg1, arg2): print('f1', arg1, arg2) def f2(arg1): print('f2', arg1)...

python 数据加密代码

1、hashlib import hashlib #创建一个哈希对象 md = hashlib.md5() #md = hashlib.sha1() #md = hashlib.sha2...

Python实现读取TXT文件数据并存进内置数据库SQLite3的方法

本文实例讲述了Python实现读取TXT文件数据并存进内置数据库SQLite3的方法。分享给大家供大家参考,具体如下: 当TXT文件太大,计算机内存不够时,我们可以选择按行读取TXT文件...

python基础教程之popen函数操作其它程序的输入和输出示例

python基础教程之popen函数操作其它程序的输入和输出示例

一、函数介绍 1.1 函数原型: 复制代码 代码如下:#include <stdio.h>FILE *popen(const char *command,const char...