pip无法安装dbus-python

时间:2019-05-14 06:06:04

标签: python-3.x

我打算安装dbus-python

$ pip --version; python --version
pip 19.0.3 from /home/me/anaconda3/lib/python3.7/site-packages/pip (python 3.7)   
Python 3.7.3

平台

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:    18.10
Codename:   cosmic

运行pip install dbus-python时,它会报告错误:

  checking for DBUS... no
  configure: error: in `/tmp/pip-install-hr9djbwg/dbus-python/build/temp.linux-x86_64-3.7':
  configure: error: The pkg-config script could not be found or is too old.  Make sure it
  is in your PATH or set the PKG_CONFIG environment variable to the full
  path to pkg-config.

  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.

检查

$ echo $PKG_CONFIG
#return nothing 

我刚刚安装了pkg-config

$ pkg-config --version
0.29.1

它仍然报告错误

  checking for DBUS... no
  configure: error: Package requirements (dbus-1 >= 1.8) 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.

但是,无法安装dbus-1

$ pip install dbus-1
Collecting dbus-1
  Could not find a version that satisfies the requirement dbus-1 (from versions: )
No matching distribution found for dbus-1

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题

首先,我查找了包裹 sudo apt-cache search dbus-1

然后我使用命令安装了必需的软件包: sudo apt install libdbus-1-3 libdbus-1-dev

希望它会为您服务

答案 1 :(得分:0)

遇到同样的问题。 dbus-python似乎是已弃用的模块。 dbus-next似乎可以替代它。

pip install dbus-next