gpt4 book ai didi

python - 如何解决 ImportError : No module named 'dbus' ?

转载 作者:太空狗 更新时间:2023-10-29 18:13:35 24 4
gpt4 key购买 nike

我在我的 ubuntu 上安装了 anaconda4,我的 Python 上有这些模块:

dbus-python (1.2.4)

gi (1.2)

pydbus (0.2)

QtAwesome (0.3.2)
qtconsole (4.2.0)
QtPy (1.0)

sip (4.18)

我尝试安装 dbus-python (1.2.4)pydbus (0.2),但是,它们都不起作用!

在python 3.5.1中测试一个简单的程序后,出现错误:

import dbus
system_bus = dbus.SystemBus()

ImportError: No module named 'dbus'

当我在 Python 2.7.11 和 3.5.1 中使用 pydbus 时:

from pydbus import SystemBus

bus = SystemBus()
systemd = bus.get(".systemd1")

for unit in systemd.ListUnits():
print(unit)

我收到这个错误:

ImportError: No module named repository

唯一有效的是 this example使用 PyQT4 我没有任何教程。

问题是什么?是我安装的还是其他的?

最佳答案

为 Python 3.6 32 位版本试试这个

pip install dbus-python

关于python - 如何解决 ImportError : No module named 'dbus' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37521162/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com