$ python3 -m pip install dbus-python
Collecting dbus-python
Using cached dbus-python-1.2.16.tar.gz (576 kB)
Building wheels for collected packages: dbus-python
Building wheel for dbus-python (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hr17s7rs/dbus-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hr17s7rs/dbus-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-2y8aldwf
cwd: /tmp/pip-install-hr17s7rs/dbus-python/
Complete output (143 lines):
running bdist_wheel
running build
creating /tmp/pip-install-hr17s7rs/dbus-python/build
creating /tmp/pip-install-hr17s7rs/dbus-python/build/temp.linux-x86_64-3.7
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific …Run Code Online (Sandbox Code Playgroud) 我想在我的 Ubuntu 上安装 HP 驱动程序 (hplip)。
它尝试安装 d-bus python 包,但失败并提示手动安装。
使用“apt”安装工作正常,但可能不适用于我的主要 Python 版本,这就是 hplip 失败的原因:
sudo apt install -y dbus
Run Code Online (Sandbox Code Playgroud)
... 效果很好
timofei@timofei:~/Downloads$ python
Python 3.8.0 (default, Oct 28 2019, 16:14:01)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 77, in <module>
import dbus.types as types
File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in <module>
from _dbus_bindings import (
ModuleNotFoundError: No …Run Code Online (Sandbox Code Playgroud)