安装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


相关文章

对Tensorflow中权值和feature map的可视化详解

对Tensorflow中权值和feature map的可视化详解

前言 Tensorflow中可以使用tensorboard这个强大的工具对计算图、loss、网络参数等进行可视化。本文并不涉及对tensorboard使用的介绍,而是旨在说明如何通过代...

Python Pandas找到缺失值的位置方法

问题描述: python pandas判断缺失值一般采用 isnull(),然而生成的却是所有数据的true/false矩阵,对于庞大的数据dataframe,很难一眼看出来哪个数据缺...

利用Python在一个文件的头部插入数据的实例

在一个文件的末尾追加数据是很常用的。在使用过程中应该都比较熟悉不会出现什么错误。但是往一个文件头部插入数据可能或多或少会碰到一些问题。 看似正确的错误代码 很多代码看似正确,但是其实都是...

django迁移数据库错误问题解决

django.db.migrations.graph.NodeNotFoundError: Migration order.0002_auto_20181209_0031 depen...

详解python实现交叉验证法与留出法

详解python实现交叉验证法与留出法

在机器学习中,我们经常在训练集上训练模型,在测试集上测试模型。最终的目标是希望我们的模型在测试集上有最好的表现。 但是,我们往往只有一个包含m个观测的数据集D,我们既要用它进行训练,又要...