no module named '_dbus_bindings'

I'm unable to open "software and updates" from the GUI or the terminal of my ubuntu 16.04 system

sudo software-properties-gtk
sudo: unable to resolve host dna-ws: Connection timed out
[sudo] password for localadmin: 
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'

I also cant install software using the GUI

I tried;

sudo apt-get install python-dbus

    sudo: unable to resolve host dna-ws: Connection timed out
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    python-dbus is already the newest version (1.2.0-3).
    python-dbus set to manually installed.
    0 to upgrade, 0 to newly install, 0 to remove and 187 not to upgrade.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up ssmtp (2.64-8ubuntu1) ...
    hostname: Temporary failure in name resolution
    dpkg: error processing package ssmtp (--configure):
     subprocess installed post-installation script returned error exit status 1
    E: Sub-process /usr/bin/dpkg returned an error code (1)

I am at a loss as to what to do to fix this and dont want to cause any damage to the system.


Solution 1:

My case, this error message, when upgrade to 3.7 from 3.6 (ubuntu 18.04):

$ pwd
/usr/lib/python3/dist-packages

$ sudo cp _dbus_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_bindings.cpython-37m-x86_64-linux-gnu.so

$ sudo cp _dbus_glib_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_glib_bindings.cpython-37m-x86_64-linux-gnu.so

Solution 2:

Seems like the package ssmtp is not fully installed. You can try reinstalling it with sudo apt install --reinstall ssmtp or if you are not running a local mail service on your computer, you can remove it with sudo apt remove ssmtp.