没有名为“_dbus_bindings”的模块-16.04

没有名为“_dbus_bindings”的模块-16.04

我一直在尝试更新 Python。自从我似乎无法访问“更新和软件”以来,
我尝试运行software-properties-gtk此错误显示:

Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 29, in <module>
    import dbus
  File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 82, 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'   

/usr/lib/python3/dist-packages/dbus 下的文件列表

bus.py         exceptions.py                lowlevel.py  service.py
_compat.py     _expat_introspect_parser.py  mainloop     types.py
connection.py  gi_service.py                proxies.py   _version.py
_dbus.py       glib.py                      __pycache__
decorators.py  __init__.py                  server.py
$ sudo apt-get install python-dbus    
python-dbus is already the newest version (1.2.0-3)

答案1

这听起来像我们之前看到的情况,好像你的系统仓库出了问题。你可以尝试运行

sudo apt dist upgrade

如果这不起作用,你可能安装了 python 3.5,让我们尝试卸载 python 3.5https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881614

sudo apt purge python3.5* 

安装 3.7

sudo apt install python3.7

看看这是否能让你摆脱困境

相关内容