Ubuntu – ImportError: No module named dbus

dbuspythonsoftware-center

I was trying to update my Python and messed up my whole system.

I am currently now able to start my Software Centre. I tried Googling multiple fixes but nothing helped. My Software Centre can't start.

When I try starting it up, this error shows:

astephen@localhost:/usr/bin$ ./software-centerGtk-Message: Failed to load module "gtk-vector-screenshot"
Traceback (most recent call last):
File "./software-center", line 36, in <module>
from softwarecenter.utils import (
File "/usr/share/software-center/softwarecenter/utils.py", line 19, in <module>
import dbus
ImportError: No module named dbus

I tried reinstalling dbus using:

apt-get install --reinstall dbus

But it did not help.

astephen@localhost:/usr/bin$ sudo apt-get install --reinstall dbusReading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not      upgraded.
Need to get 0 B/231 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 676272 files and directories currently installed.)
Preparing to unpack .../dbus_1.6.18-0ubuntu4.3_amd64.deb ...
Unpacking dbus (1.6.18-0ubuntu4.3) over (1.6.18-0ubuntu4.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up dbus (1.6.18-0ubuntu4.3) ...

Best Answer

A quick search reveals that the name of the Debian package for the Python DBUS module is called python-dbus (or python3-dbus). Why it isn't available despite being an explicit dependency of the software-center package is beyond me. You should re-install the two packages in case they were corrupted:

sudo apt-get install --reinstall software-center python-dbus
Related Question