首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在装有Python3.8的Ubuntu上安装dbus-python

无法在装有Python3.8的Ubuntu上安装dbus-python
EN

Stack Overflow用户
提问于 2020-02-28 09:47:38
回答 1查看 3.3K关注 0票数 0

我想在我的Ubuntu上安装HP驱动(hplip)。

它尝试安装d-bus python包,但失败了,并要求手动安装。

使用"apt“安装很好,但可能不适用于我的主要Python版本,这就是hplip失败的原因:

代码语言:javascript
复制
sudo apt install -y dbus

..。效果很好

代码语言:javascript
复制
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 module named '_dbus_bindings'

所以我试了一下:

代码语言:javascript
复制
pip3 install dbus-python

但没有成功:

代码语言:javascript
复制
    subprocess.CalledProcessError: Command '['/tmp/pip-install-d0ae2vew/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/usr/bin/python3', '--prefix=/tmp/pip-install-d0ae2vew/dbus-python/build/temp.linux-x86_64-3.8/prefix']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d0ae2vew/dbus-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d0ae2vew/dbus-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivj6cz_0/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/timofei/.local/include/python3.8/dbus-python Check the logs for full command output.

我试过了

代码语言:javascript
复制
pip3 install --upgrade setuptools

,它运行良好。

我能做什么?

EN

回答 1

Stack Overflow用户

发布于 2020-03-17 19:20:21

试试这个:

代码语言:javascript
复制
sudo apt-get install libdbus-1-dev libdbus-glib-1-dbus
sudo pip3 install autokey
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60444193

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档