安装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 pymongo模块常用操作分析

Python pymongo模块常用操作分析

本文实例讲述了Python pymongo模块常用操作。分享给大家供大家参考,具体如下: 环境:pymongo3.0.3,python3 以下是我整理的一些关于pymongo的操作,网上...

Python MongoDB 插入数据时已存在则不执行,不存在则插入的解决方法

本文实例讲述了Python MongoDB 插入数据时已存在则不执行,不存在则插入的解决方法。分享给大家供大家参考,具体如下: 前言: 想把QQ日志爬虫(Python)爬下来的日志保存到...

Python获取DLL和EXE文件版本号的方法

本文实例讲述了Python获取DLL和EXE文件版本号的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:import win32api def getFileVers...

Python 绘图和可视化详细介绍

Python之绘图和可视化 1. 启用matplotlib 最常用的Pylab模式的IPython(IPython --pylab) 2. matplotlib的图像都位于Figure对...

python实现红包裂变算法

python实现红包裂变算法

本文实例介绍了python实现红包裂变算法,分享给大家供大家参考,具体内容如下 Python语言库函数 安装:pip install redpackets 使用: import r...