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


相关文章

python2与python3中关于对NaN类型数据的判断和转换方法

python2与python3中关于对NaN类型数据的判断和转换方法

今天在对一堆新数据进行数据清洗的时候,遇到了一个这样的问题: ValueError: cannot convert float NaN to integer 一开始是这样的,我用...

使用Python简单的实现树莓派的WEB控制

使用Python简单的实现树莓派的WEB控制

先给大家展示下效果如图,感觉还很满意请继续阅读全文:   用到的知识:Python Bottle HTML Javascript JQuery Bootstrap AJAX...

Python中pip更新和三方插件安装说明

Python中pip更新和三方插件安装说明

一、Python安装: 最新Python版本的下载和安装可以参考我的这篇博客,里面有步骤说明和注意事项。 二、手动更新pip:在安装第三方插件时如果提示pip版本需更新,可以这样做: 1...

tensorflow更改变量的值实例

如下所示: from __future__ import print_function,division import tensorflow as tf #create a Var...

解决DataFrame排序sort的问题

如下所示: result = result.T.sort(['confidence','support'], ascending = False) 报以下错误: Attribu...