Python errors trying to run mopidy

Hi - I’m getting the following errors running Mopidy. Any suggestions?
I don’t really know python

tim-office-ubuntu:~$ mopidy
Traceback (most recent call last):
  File "/usr/bin/mopidy", line 9, in <module>
    load_entry_point('Mopidy==1.1.1', 'console_scripts', 'mopidy')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/mopidy/__main__.py", line 43, in <module>
    from mopidy import commands, config as config_lib, ext
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 16, in <module>
    from mopidy import config as config_lib, exceptions
  File "/usr/lib/python2.7/dist-packages/mopidy/config/__init__.py", line 11, in <module>
    from mopidy.config import keyring
  File "/usr/lib/python2.7/dist-packages/mopidy/config/keyring.py", line 8, in <module>
    import dbus
  File "/usr/lib/python2.7/dist-packages/dbus/__init__.py", line 81, in <module>
    import dbus.exceptions as exceptions
AttributeError: 'module' object has no attribute 'exceptions'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 16, in <module>
    from xml.parsers.expat import ExpatError
  File "/usr/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so: undefined symbol: XML_SetHashSalt

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/mopidy", line 9, in <module>
    load_entry_point('Mopidy==1.1.1', 'console_scripts', 'mopidy')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/mopidy/__main__.py", line 43, in <module>
    from mopidy import commands, config as config_lib, ext
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 16, in <module>
    from mopidy import config as config_lib, exceptions
  File "/usr/lib/python2.7/dist-packages/mopidy/config/__init__.py", line 11, in <module>
    from mopidy.config import keyring
  File "/usr/lib/python2.7/dist-packages/mopidy/config/keyring.py", line 8, in <module>
    import dbus
  File "/usr/lib/python2.7/dist-packages/dbus/__init__.py", line 81, in <module>
    import dbus.exceptions as exceptions
AttributeError: 'module' object has no attribute 'exceptions'
timpigden@tim-office-ubuntu:~$ ^C
timpigden@tim-office-ubuntu:~$

Edited: Formatted exception. -jodal

The important part of the error is:

  File "/usr/lib/python2.7/dist-packages/mopidy/config/__init__.py", line 11, in <module>
    from mopidy.config import keyring
  File "/usr/lib/python2.7/dist-packages/mopidy/config/keyring.py", line 8, in <module>
    import dbus
  File "/usr/lib/python2.7/dist-packages/dbus/__init__.py", line 81, in <module>
    import dbus.exceptions as exceptions
AttributeError: 'module' object has no attribute 'exceptions'

How did you install Mopidy? From “ubuntu” in your hostname and the paths I see in the error I’m guessing it was installed from APT, on Ubuntu?

Can you provide the output of mopidy deps and dpkg -l | grep python-dbus? I’d like to know exactly which version you have of the dbus dependency which seems to be missing it’s exceptions module.

I’ll give it a go but away from office for a couple of days

Hi

dpkg -l gives
ii python-dbus 1.2.0-2build2 amd64 simple interprocess messaging system (Python interface)
ii python-dbus-dev 1.2.0-2build2 all main loop integration development files for python-dbus

mopidy deps just gives the traceback which in full is
$ mopidy deps
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==1.1.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2363, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2088, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 43, in
from mopidy import commands, config as config_lib, ext
File “/usr/lib/python2.7/dist-packages/mopidy/commands.py”, line 16, in
from mopidy import config as config_lib, exceptions
File “/usr/lib/python2.7/dist-packages/mopidy/config/init.py”, line 11, in
from mopidy.config import keyring
File “/usr/lib/python2.7/dist-packages/mopidy/config/keyring.py”, line 8, in
import dbus
File “/usr/lib/python2.7/dist-packages/dbus/init.py”, line 81, in
import dbus.exceptions as exceptions
AttributeError: ‘module’ object has no attribute 'exceptions’
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/apport_python_hook.py”, line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File “/usr/lib/python2.7/dist-packages/apport/init.py”, line 5, in
from apport.report import Report
File “/usr/lib/python2.7/dist-packages/apport/report.py”, line 16, in
from xml.parsers.expat import ExpatError
File “/usr/lib/python2.7/xml/parsers/expat.py”, line 4, in
from pyexpat import *
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so: undefined symbol: XML_SetHashSalt

Original exception was:
Traceback (most recent call last):
File “/usr/bin/mopidy”, line 9, in
load_entry_point(‘Mopidy==1.1.1’, ‘console_scripts’, ‘mopidy’)()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2363, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 2088, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/lib/python2.7/dist-packages/mopidy/main.py”, line 43, in
from mopidy import commands, config as config_lib, ext
File “/usr/lib/python2.7/dist-packages/mopidy/commands.py”, line 16, in
from mopidy import config as config_lib, exceptions
File “/usr/lib/python2.7/dist-packages/mopidy/config/init.py”, line 11, in
from mopidy.config import keyring
File “/usr/lib/python2.7/dist-packages/mopidy/config/keyring.py”, line 8, in
import dbus
File “/usr/lib/python2.7/dist-packages/dbus/init.py”, line 81, in
import dbus.exceptions as exceptions
AttributeError: ‘module’ object has no attribute 'exceptions’
timpigden@tim-office-ubuntu:~$